Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to get Sales smaller than current month.
Below works fine for current month.
Sum({$<Month={'$(=Month(Today()))'}>}[Sales])
When adding:
Sum({$<Month={<='$(=Month(Today()))'}>}[Sales])
It doesn't work. I tried so many variations..
Some help would be very much appreciated!
What is the format of your month field?
Try creating a numeric month field
LOAD
Month(Date) as Month,
Num(Month(Date)) as MonthNum,
...
Then
Sum({$<MonthNum ={"<=$(=Num(Month(Today())))"}>} [Sales])
Try this:
Sum({$<Month={'<=$(=Month(Today()))'}>}[Sales])
What is the format of your month field?
Try creating a numeric month field
LOAD
Month(Date) as Month,
Num(Month(Date)) as MonthNum,
...
Then
Sum({$<MonthNum ={"<=$(=Num(Month(Today())))"}>} [Sales])
Or you can also use DateField:
Sum({$<Month={"$(='<' & Date(MonthStart(Today()), 'DateFieldFormatHere'))"}>} [Sales])
Thanks, does Qlik not understand the expression without nummeric value? Kind of strange, no?
Yeah, could be kind of confusing / strange, see also the comments below