Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rakeshshah
Partner - Creator
Partner - Creator

Changes in behaviour when adding conditional statement around set analysis.

Hi All

Wondering if someone could help explain why Qlik behaves this way....

When I use the following set analysis statement: 

sum({<Year=,Quarter={'Q3'},Unit={'2000=100'},SubCategory={'Indx of Customer Price'}>}CPI)

the use of {<Year=, means that when a value(s) of Year are selected from the selection pane it does not filter any of the data.

Without Condition Statement.PNG

However when you add any conditional statements in front of this  say...

if(SubCategory='Indx of Customer Price',
<set analysis>
)

 then when you apply the same Year selection - it marks the non-selected values as null, instead of leaving them there as it did with-out the conditional statement. The same happens if you use match, pick statements as well.

 

NB there is no other "SubCategory" values just 

With Condition Statement.PNG

I've attached a very light demo app with instructions and how the behaviours are different if this helps explain.

Labels (3)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try including same set analysis components with the if condition like:

if(only({<Year>}SubCategory)='Indx of Customer Price'

View solution in original post

4 Replies
Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

remove  year=  from the set expression

Thanks

Thanks and Regards
Kashyap.R
tresesco
MVP
MVP

Try including same set analysis components with the if condition like:

if(only({<Year>}SubCategory)='Indx of Customer Price'

rakeshshah
Partner - Creator
Partner - Creator
Author

We don't want Years to filter out.

We know how to do workarounds - I'm looking to understand why the behaviour changes when the "if condition" is added in front.

 

rakeshshah
Partner - Creator
Partner - Creator
Author

Thanks @tresesco - this worked, and had to be the full set analysis of what was inside the condition statement.

if(only({<Year=,Unit={'2010 = 100'},Quarter={'3rd Quarter'}>}Subcategory)='Index of Consumer Prices',
sum({<Year=,Unit={'2010 = 100'},Quarter={'3rd Quarter'}>} CPI)
)