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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Dynamic set analysis

Hi, I have a question:

I have a data set which has a City dimension and a State dimension and a measure Sales.

I'd like to create a KPI which shows the State average sales for the state to which the City in the filter pane that has been selected belongs. So for example: if "San Francisco" is selected in the City filter pane, the KPI must show the average sales amount for California, if Houston is selected, then Texas, etc.

I know it can be done with set analysis, I just don't get the exact syntax.

Kind regards and thanks in advance!

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

Try

Sum( {$<City=,State=P(State)>} Sales )

HIC

View solution in original post

2 Replies
hic
Former Employee
Former Employee

Try

Sum( {$<City=,State=P(State)>} Sales )

HIC

Anonymous
Not applicable
Author

Thank you! It works