Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
mskusace
Creator
Creator

Filter Two Visualizations by 1 common element - Alternate States

I have an app with 2 visualizations. One visualization (Visualization A) is an area chart that is grouped by "Date" with an area of "X" and a height of "Y". The second visualization (Visualization B) is a stacked bar chart with "Location" as the Bar and "A", "B", "C", and "D" as the heights.

I want BOTH visualizations (Visualization A and Visualization B) to be filterable by "Location". 

I want ONLY Visualization B to be filterable by "Date". 

Visualization A should ALWAYS cover the entire range in the "Date" field and should not drill down by date.

Example: If I filter by a date in the "Date" field, ONLY Visualization B should drill down to that date. 

If I filter by a "Location", BOTH Visualization A and Visualization B should drill down to that location.

If I filter by a date and location, ONLY Visualization B should drill down to the date, and BOTH Visualization A and B should drill down to the location.

I tried using alternate states, but I can only get Visualization A filterable by one field and Visualization B filterable by another field, independent of each other. Any guidance or assistance would be greatly appreciated!

Labels (2)
1 Solution

Accepted Solutions
Chirag2397
Contributor II
Contributor II

Suppose we are finding sum of sales

and chart B is dependent on Location and Date whereas chart A is only dependent on Location.

For chart A: sum(<Date=>Sales)

For chart B: sum(Sales).

I think this will work according to your requirement.

View solution in original post

3 Replies
Chirag2397
Contributor II
Contributor II

Suppose we are finding sum of sales

and chart B is dependent on Location and Date whereas chart A is only dependent on Location.

For chart A: sum(<Date=>Sales)

For chart B: sum(Sales).

I think this will work according to your requirement.

mskusace
Creator
Creator
Author

I appreciate your reply! 

The formula for Visualization A is: (SUM(X1 + X2) / SUM(X2)) -1

I tried: (SUM(<Date=>(X1+X2))/SUM(<Date=>X2)) - 1, but there is an error in the expression with ')' expected.

Am I not inputting something correctly?

 

mskusace
Creator
Creator
Author

Oh, I think I got it.

=(SUM({<Date=>}(X1+X2))/SUM({<Date=>}X1)) - 1

Wow, this works great! Thank you!