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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Anaylsis Question

Hi,

I tried this:

sum (if(User='John'),{<YTD_FPY={1},Year=>} Sales)

it's not working 😞

If I move the set analysis syntax before the if it works.

sum ({<YTD_FPY={1},Year=>} if(User='John', Sales))

Can someone please explain me why it has to be that way.

ps: I know that sum({<YTD_FPY={1},Year=, User={'John'}>} Sales) would be also an option.

Thanks

Matt

1 Reply
stephencredmond
Partner - Specialist II
Partner - Specialist II

Hi Matt,

It doesn't work because the result of the if:

{<YTD_FPY={1},Year=>} Sales

Doesn't stand as a valid result.

I would go with your last option - no point in mixing Ifs and sets when you can just use the set.

Stephen