Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Filtering in charts where dimension set by variable

Good day one and all,

I am having a minor frustration with something relating to variables, filtering and clearing said filters.

I have a variable which toggles between being set as 'Admitting' and 'Discharging'.  In a chart I am using a calculated dimension which uses the variable to determine whether to bring in the admitting column or the discharging column.

E.g. with the variable set to 'Admitting' the admitting column values display along with the related vales in contained with the expression:

Chart 1.png

If a value from the admitting column is selected, the data is filtered to show just this value (which is what I would be expecting).

Chart1-Filtered.png

Normally in Qlikview you click on the value again (in this case Medical Oncology) to clear the filter/selection.  This is where I am having the issue, as no amount of clicking will clear the filter/selection.  The only way is to use clear all or the back button - neither of which are ideal.

Does anyone have any experience of this? Is this something that is just a quirk of Qlikview (due to using a variable) or is it something that can be resolved?

Many thanks

Tim

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Well, since you're using a calculated dimension that uses two dimensions in the expression, when you click on a bar then values are selected in both fields. What you can do instead is use a variable as calculated dimension and calculate which dimension should be used in that variable. See attached example.


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Nicole-Smith

When I have hit this problem in the past, I've been able to get around it by wrapping my calculated dimension in the aggr() function.

Gysbert_Wassenaar

Well, since you're using a calculated dimension that uses two dimensions in the expression, when you click on a bar then values are selected in both fields. What you can do instead is use a variable as calculated dimension and calculate which dimension should be used in that variable. See attached example.


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you Gysbert! That's exactly what I needed.  I had actually made a stab at this earlier but hadn't quite got the syntax right so your example sorted that out for me.

Really appreciate your help.