Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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

Try as follow:

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

result:

Capture.PNG

adj29block
Contributor III
Contributor III

Hi Krishna,

Look at the attached PDF


J-B

luismadriz
Specialist
Specialist

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
Specialist
Specialist

Hi Krishna,


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

Many thanks,

Luis