Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello guys,
I was wondering if this happened to someone else after the last update.
I need to show current month sales and sales to date (eg. May x Jan...May) in the same table widget.
The measures below worked flawlessly until I was forced to update Qlik Sense Desktop to SR3 one week ago.
A-Sales to date (e.g. Jan.... May)
----
sum({$<[Year]={$(=MAX([Year]))}, Month={'<=$(=MAX(Month))'}>} SALES)
B-Current month sales
----
sum({$<[Year]={$(=MAX([Year]))}>} SALES)
To my suprise, both expressions evaluate to the same value at the moment --- as if the Month={'<=$(=MAX(Month))' part in expression A didn't exist.
Has anyone had similar issues? Tried to find some clues in the release notes, without luck.
regards
Hi Marcel,
Seems to be working fine here for me (i'm also using SR3 update).
Check the attached QVF file to see if it helps you.
What i think you mean when both expressions are the same is that you need to select one Date, in my case, for the expression for the monthly expression to change.
Since no date is selected, the second expression (right one) will be calculated for all the months.
Regards,
Felipe.
Hello Felipe
Indeed I forgot to mention that I had a filter in place exactly as you suggested. Even so, the year-to-date sales expression isn't working.
But thanks for your insight and for the sample data. Although that expression hasn't changed at all between updates, something must have happened because of the new dataset introduced on May.
Regards.
After some trial and error, I finally figured out what happened. There was definitely a change on how expressions are evaluated in SR3 albeit our code has definitely improved after this.
I was using an expression like MonthExpr = num([MonthField]) -- just found out that it is redundant. All of my month filters were defined in terms of "MonthExpr" and not [MonthField] directly.
When I replaced all these occurrences with [MonthField] instead, it worked again.
FROM
sum({$<[Year]={$(=MAX([Year]))}, Month={'<=$(=MAX(Month))'}>} SALES)
TO
sum({$<[Year]={$(=MAX([Year]))}, [MonthField]={'<=$(=MAX([MonthField]))'}>} SALES)
Anyway, I am going to use square brackets more often from now on.