I am visualising basic family income data.
So i have a household id number, name of income earner, gender of income earner, and amount of income per earner, like this:
HHID, name, gender, amount1, John, m, 3001, Sally, f, 4001, Maria, f, 4502, Steve, m, 20002, Rory, m, 5003, Martha, f, 7503, Arla, f, 1000
So then I want to show a bar chart of the income per household (not income per earner).
So the bar chart should show:
HH 1 = 1150
HH2 = 2500
HH3 = 1750
Thanks if you can help me with this!
you can use the below settings for your bar chart:
- HHID as dimension field
sum(amount) as expression measure.
This isn't quite what I was hoping for.
I have about 500 households - so it isn't a huge dataset, however, this gives me a bar chart of over 500 bars, which doesn't allow me to actually categorise the results.
So I'd rather have the measure as the count of the number of the households.
And the dimension as the household income amount.
Does that make sense?
You can use aggregate calculated dimension:
Dimension: aggr(sum(amount), hhid)Measure: count(hhid)
For better visualization, you should bin the dimension to just around under 10 ranges.
if(aggr(sum(amount), hhid) < 1000, [0,1000),
if(aggr(sum(amount), hhid) < 2000, [1000,2000),
if(aggr(sum(amount), hhid) < 3000, [2000,3000),