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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
juriengroot
Contributor III
Contributor III

Set analysis smaller than current Month

  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!

1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

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])

View solution in original post

5 Replies
sunny_talwar
MVP
MVP

Try this:


Sum({$<Month={'<=$(=Month(Today()))'}>}[Sales])

swuehl
Champion III
Champion III

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])

sunny_talwar
MVP
MVP

Or you can also use DateField:

Sum({$<Month={"$(='<' & Date(MonthStart(Today()), 'DateFieldFormatHere'))"}>} [Sales])

juriengroot
Contributor III
Contributor III
Author

Thanks, does Qlik not understand the expression without nummeric value? Kind of strange, no?

swuehl
Champion III
Champion III

Yeah, could be kind of confusing / strange, see also the comments below

Dates in Set Analysis