Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
zahidrahim_ocp
Partner - Creator
Partner - Creator

Simple Set Expression for two dates

Dear Qlik Experts,

I want to write a set expression based on two conditions but it is not working. I want to see sum for records which have APPLY_DATE_AT is less than or equal to selected date in a variable (filter date) and TRX_DATE is Greater than previous month and less than the date selected.

Sum(

{<APPLY_DATE_AT = {"$(='<=' & Date(Max(TRX_DATE)))"}>*<TRX_DATE = {"$(='>=' & Date(AddMonths(TRX_DATE,-1)+1))"}>*<TRX_DATE = {"$(='<=' & Date(TRX_DATE))"}>} AMOUNT_TAKEN

)


Regards,


Zahid Rahim

1 Solution

Accepted Solutions
sunny_talwar

Try this

Sum({<APPLY_DATE_AT = {"$(='<=' & Date(Max(TRX_DATE)))"}, TRX_DATE = {"$(='>=' & Date(AddMonths(Max(TRX_DATE),-1)+1) & '<=' & Date(Max(TRX_DATE)))"}>} QUANTITY)

View solution in original post

23 Replies
sunny_talwar

May be this

Sum({<APPLY_DATE_AT = {"$(='<=' & Date(Max(TRX_DATE)))"}>*<TRX_DATE = {"$(='>=' & Date(AddMonths(Max(TRX_DATE),-1)+1)) & '<=' & Date(Max(TRX_DATE)))"}>} AMOUNT_TAKEN)

zahidrahim_ocp
Partner - Creator
Partner - Creator
Author

Dear Sunny,

Thank you for the reply. But it is not showing anything at all.

Regards,

Zahid Rahim

sunny_talwar

My bad, try this

Sum({<APPLY_DATE_AT = {"$(='<=' & Date(Max(TRX_DATE)))"}>*<TRX_DATE = {"$(='>=' & Date(AddMonths(Max(TRX_DATE),-1)+1) & '<=' & Date(Max(TRX_DATE)))"}>} AMOUNT_TAKEN)

zahidrahim_ocp
Partner - Creator
Partner - Creator
Author

Same Result Not showing anything.

pradosh_thakur
Master II
Master II

May be this

=Sum( { <APPLY_DATE_AT = {"$(='<=' & Date(Max(TRX_DATE)))"}> * <TRX_DATE = {"$(='>=' & Date(AddMonths(TRX_DATE,-1)+1) &  '<=' & Date(TRX_DATE))"}>} AMOUNT_TAKEN )

and can you check what is the default date format and the format of you date in the dashboard

regards

Pradosh

Learning never stops.
zahidrahim_ocp
Partner - Creator
Partner - Creator
Author

Dear Pradosh,

Not working.

if i remove first condition it is showing records with additional apply_date_at.

=Sum( {  <TRX_DATE = {"$(='>=' & Date(AddMonths(TRX_DATE,-1)+1) &  '<=' & Date(TRX_DATE))"}>} AMOUNT_TAKEN )

Formats are same.

regards,

Zahid

sunny_talwar

Would you be able to share a sample to look at?

zahidrahim_ocp
Partner - Creator
Partner - Creator
Author

Dear Sunny,

PFA

Regards,

Zahid Rahim

sunny_talwar

It would be helpful to know what the expected output you are looking to get from this chart?