Pivoting columns
In this recipe, we will prepare the data set that we used in the Creating a population pyramid recipe of Chapter 2, Advanced Charts. The original file, which is a comma separated value (CSV) file, looks like the following:
Getting ready
To follow this recipe, download the file from BCStats using the following URL:
http://www.bcstats.gov.bc.ca/StatisticsBySubject/Demography/PopulationProjections.aspx.
When you download, make the following selections and click on Generate Output:
Select British Columbia for Region
Select all the years
Select totals
Select 5-Year Age Groups
Beside the result pane, click on the CSV icon at the top-right corner of the result pane to download the .csv
file. Save the file as Population_Projections.csv
.
How to do it...
Here are the steps to prepare the .csv
file:
Click on New Data Source icon and connect to the text file in this recipe:
Select all the age groups that are presented as individual columns.
While all the age group columns are selected, right-click...