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: 
bhaveshp90
Creator III
Creator III

How to set expression to check the last 30 days?

Hello,

How Can I set the expression to my date column, so that it will filter only for the Last 30 days?

1 Solution

Accepted Solutions
bhaveshp90
Creator III
Creator III
Author

We need to put 0 instead -1 (0 for last month, -1 for two months, ...) here and it worked out. thank you Sunny

Sum({<Snapshot_Date = {">=$(=Date(Addmonths(Max({1} Snapshot_Date),0), 'YYYY-MM-DD'))"}>} Go_Live)

View solution in original post

15 Replies
marinadorcassio1
Partner - Creator
Partner - Creator

You should add a set analysis in your differents expressions in order to filter on the last 30 days.

Hope it helps,

Regard,

Marina

sudeepkm
Specialist III
Specialist III

something like below:

sum({<[Year Field]=,[Month Field]=, [Your Date Field]={">=$(=Date(Today()-30))<=$(=Today())"} >} SalesVolume)

bhaveshp90
Creator III
Creator III
Author

I have added this expression but I am unable to get the last 30 days data

Sum({<Snapshot_Date = {">=$(=Addmonths(Max(Snapshot_Date),-1))"}>}Go_Live)

sunny_talwar

What is the format for Snapshot_Date?

dplr-rn
Partner - Master III
Partner - Master III

whats the dimensions in your chart?

if it has Snapshot_Date as a dimension the expression will not work

bhaveshp90
Creator III
Creator III
Author

The format for Snapshot_Date is  '2018-08-31'

bhaveshp90
Creator III
Creator III
Author

I have Project Number as the Dimension and PAC Delay as Expression. I do not have Date in my Dimension 

sunny_talwar

Try this

Sum({<Snapshot_Date = {">=$(=Date(Addmonths(Max(Snapshot_Date),-1), 'YYYY-MM-DD'))"}>} Go_Live)

dplr-rn
Partner - Master III
Partner - Master III

What is the output that you are getting