Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Age distribution based on selected area's

Sorry I'm pretty new to Qlikview, however I was unable to find an answer.

I'm looking to produce an age distribution graph based on the postcode selected.  The data is similar to below (I've simplified it)

Postcode# people age 1-10# people age 10-20# people age 20-30# people age 30Plus
000115202510
00022530405
000310301015

Selecting 1 or more postcodes will then produce a line graph with 4 values on the a axis (1-10, 10-20, 20-30, 30+) and the Y axis showing the sum of people in each category

Thanks,

Dougal

1 Solution

Accepted Solutions
Not applicable
Author

Hi Dougal,

If that's how your initial data looks like then you can use the crosstable load function:

data:
LOAD * Inline [
Postcode, Age 1-10, Age 10-20, Age 20-30, Age 30+
0001,15,20,25,10
0002,25,30,40,5
0003,10,30,10,15
];

datafinal:
CrossTable(Category, Nbr, 1)
LOAD Postcode,
[Age 1-10],
[Age 10-20],
[Age 20-30],
[Age 30+]
Resident data;
DROP Table data;

Then in your chart use the Category as dimension and sum(Nbr) as expression.

Hope this helps you.

View solution in original post

2 Replies
Not applicable
Author

Hi Dougal,

If that's how your initial data looks like then you can use the crosstable load function:

data:
LOAD * Inline [
Postcode, Age 1-10, Age 10-20, Age 20-30, Age 30+
0001,15,20,25,10
0002,25,30,40,5
0003,10,30,10,15
];

datafinal:
CrossTable(Category, Nbr, 1)
LOAD Postcode,
[Age 1-10],
[Age 10-20],
[Age 20-30],
[Age 30+]
Resident data;
DROP Table data;

Then in your chart use the Category as dimension and sum(Nbr) as expression.

Hope this helps you.

Not applicable
Author

Thanks, that's what I'm after