Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
pauldamen
Partner - Creator II
Partner - Creator II

Sums in chart for different levels hierarchy

Hi all,

I have a hierarchy which contains States -> Regions -> Cities. I want to create 1 bar chart which shows the sum for the selected city, the sum for the region where the city belongs to and the last bar should show the total for the state.

How can I achieve this?

Thanks for the help!

Regards,

Paul

1 Solution

Accepted Solutions
Gysbert_Wassenaar

I think you can do this with set analysis expressions for State and Region. A chart with no dimensions and three expression something like:

State: sum({1<State=p()>} Value)

Region: sum({1<Region=p()>} Value)

City: sum(Value)


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Gysbert_Wassenaar

I think you can do this with set analysis expressions for State and Region. A chart with no dimensions and three expression something like:

State: sum({1<State=p()>} Value)

Region: sum({1<Region=p()>} Value)

City: sum(Value)


talk is cheap, supply exceeds demand
pauldamen
Partner - Creator II
Partner - Creator II
Author

Works great! Thanks a lot!

Just out of my interest, what does the p mean and what does it do in the formula?

Regards,

Paul

pauldamen
Partner - Creator II
Partner - Creator II
Author

Other question:

I also have a chart which only consists off the cities. But they are selected in 2 different listboxes with 2 different states. In the first listbox with state 1 I selected 1 city which I want to compare with 3 cities which are selected in the listbox with state 2.

I want to make a line chart which show the 4 cities compared to each other over a couple of years.

How to a put both alternate states in 1 chart?

Regards,

Paul

Gysbert_Wassenaar

There's an example in the What's new in Qlikview 11 qvw. You can find that here: http://eu.demo.qlik.com/detail.aspx?appName=Whats%20New%20in%20QlikView11.qvw

See the Product Grouping tab of the qvw file.


talk is cheap, supply exceeds demand
pauldamen
Partner - Creator II
Partner - Creator II
Author

Hi,

I know that one the problem is my alternate states are x axis value so I can't put them in the expression?

Because the cities are on the X axis but should show all selected cities in both alternate states.

Regards,

Paul