Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 |
|---|---|---|---|---|
| 0001 | 15 | 20 | 25 | 10 |
| 0002 | 25 | 30 | 40 | 5 |
| 0003 | 10 | 30 | 10 | 15 |
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
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.
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.
Thanks, that's what I'm after