Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want to have a straight table in Qlik which shows 2 columns, 1 dimension (product) and 1 measure which react to the Switch filter (i.e. MTH or YTD). See expressions below:
IF(SWITCH='YTD', SUM({<Month={"<=$(=max(Month))"}>}Sales), SUM(Sales))
To create the filter Switch i created a data island:
LOAD * INLINE[SWITCH
YTD
MTH];
However the expression is not working. I created three different measures to test it:
1. Product
2. Expression for MTH values
3. Expression for YTD values
4. Expression with IF condition for MTH or YTD values
The expression in the column 4 does not work since it does not calculates the sales for all products in the table. However, column 3 shows all values and that is that I want. I suspect, the problem is coming from the data island.
Any idea?
Many thanks in advance!
Try IF(GetFieldSelections(SWITCH)='YTD', SUM({<Month={"<=$(=max(Month))"}>}Sales), SUM(Sales))
Hi,
Thanks and but unfortunately it does work as well
Hi,
can you attach here your QVW file?