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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
AnnieV
Contributor
Contributor

Qlik Sense measure expression between two dates

Hi,

I have an app where I'm trying to display the sum of sales over the past 3 months
there is 1 table with sales & dates, and 1 table with date values (+ first day of month 3 months ago +last day of last month)
I use the following expression:

"    Sum({<Date={">=3MonthsAgo <=LastMonthEnd"}>} Sales)    "

but it does not work. When I replace 3MonthsAgo and LastMonthEnd with a random date ("1/1/2017") it does work.
Is my expression wrong?

Labels (2)
4 Replies
arulsettu
Master III
Master III

Maybe like this Sum({<Date={">=$(Monthstart(3MonthsAgo)) <=$(Monthend(LastMonthEnd))"}>} Sales)

AnnieV
Contributor
Contributor
Author

Unfortunately that doesn't work either 😕


when the 2 tables are not linked:

AnnieV_0-1592909023881.png

 

when the 2 tables are linked:

AnnieV_1-1592909200221.png

 

the expressions editor shows this:

AnnieV_2-1592909260486.png

 

arulsettu
Master III
Master III

Can you share the sample app and the output you are expecting?

NitinK7
Specialist
Specialist

Hi,

try like below expression

Sum({<Date={">=$(=date(MonthStart(today()-90),'DD/MM/YYYY'))<=$(=date(MonthEnd(today()),'DD/MM/YYYY'))"}>}Sales)

 

 

Thanks,

Nitin.