Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a Histogram (frequency distribution) for some weights, on my dashboard I have 3 different graphs, each with a unique set of data so a standard filter won't help as I have data for X on week 1 but not for Y on week 1.
So I am trying to use an if statement to generate the correct filter.
=if([X] = 'ABC', [Weight (kg)])
^ The above works correctly, so I now need to have an additional if for the week number being 13, not sure if Qlik is like Excel whereby if changes to ifs?
The below is a 'set expression' from the current filter so I imagine that is what I need to try fit into the above expression.
= if({Date] = <"=Dual('W'&Num(Week([Date]),00),Num(Week([Date]),00))"={'W13'}>, [Weight (kg)]
extra credit: Is it possible to add a bit of intelligence into the expression so I don't have to manually change 'W13' as new data comes in? I imagine by using a max function?
Any help would be appreciated.
1. Qlik Sense can have IF statements with multiple fields like IF (Field1 = 'ABC' and Week(Date) = 14, then value, else value)
2. You don't need to mix IF and Set Analysis together. You could use Set Analysis on it's own
Sum({<Week={14}>}Score)
3. For the extra credit, which I always want ... yes Set Analysis can handle your using complex expressions/functions. General Syntax is $(= Expression) (That's called Dollar Sign Expansion within Qlik) Refer to this Community Post where I shared a hands on workshop. From Pages 1-19 I use Year = with a physical value, and then on page 20 I demonstrate how to use expression so that it's flexible and will work in the future. https://community.qlik.com/t5/Documents/Hands-on-Set-Analysis-from-the-ground-up/ta-p/1799118