Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
krishna4bo
Contributor

filter Last 30 days data.

Hi All,

How to filter Last 30 days data.

My expression: It is not working.

Sum({<Affected_Date={'>=$(=max(Affected_Date)-30)<=$(=max(Affected_Date))'}>}[Overall Availability%])

Pls help me.

Thanks,

Krishna

4 Replies
OmarBenSalem
Esteemed Contributor

Re: filter Last 30 days data.

Try as follow:

Sum({< Affected_Date={">=$(=addmonths(max(Affected_Date),-1)) <= $(=max(Affected_Date))"}>}[Overall Availability%])

result:

Capture.PNG

adj29block
New Contributor III

Re: filter Last 30 days data.

Hi Krishna,

Look at the attached PDF


J-B

luismadriz
Valued Contributor

Re: filter Last 30 days data.

Hi Krishna,

your expression was almost perfect, the only thing you needed to do was to transform max(...)-30 to a date

Sum({<Affected_Date={'>=$(=date(max(Affected_Date)-30))<=$(=max(Affected_Date))'}>}[Overall Availability%])

Untitled.png

I like Omar's proposal better because it subtracts a whole month but of course, it all depends on your requirements,

I hope this helps,

Regards,

Luis

luismadriz
Valued Contributor

Re: filter Last 30 days data.

Hi Krishna,


Please remember to close the thread by marking the correct and helpful replies,

Many thanks,

Luis