Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help in set analysis expression!!

Hi

i need to write an expression like ver i need to select all the measures in the last day of previous three months

if current selection is month=dec and year= 2011

then the measures should be from the date '31-Nov-2011', '31-Oct-2011' and '31-Sep-2011'

i knid of came up with an expression but never worked.

SUM({< DATE = {"=$(=MonthEnd(Addmonths(DATE,-1)),=MonthEnd(Addmonths(DATE,-2)),=MonthEnd(Addmonths(DATE,-3))"} >} Measure)

plz help me with the correct expression

2 Replies
chematos
Specialist II
Specialist II

Try this and tell me if it works

SUM({<DATE={"=$(=MonthEnd(Addmonths(DATE,-1))"},DATE={"=$(=MonthEnd(Addmonths(DATE,-2))"},DATE={"=$(=MonthEnd(Addmonths(DATE,-3))"} >} Measure)

Hope this helps.

Regards,

Chema

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Check with it,you have to enter it as comma separated without equal sign

     SUM({< DATE = {'$(=MonthEnd(Addmonths(DATE,-1))','MonthEnd(Addmonths(DATE,-2))','MonthEnd(Addmonths(DATE,-3))'} >} Measure)

Note: Check whether your date field is in the format returned by the monthend(which will be as MM/DD/YYYY) function .If it is not in that format for ex it is in DD/MM/YYYY format then use $(=Date(MonthEnd(Addmonths(DATE,-1),'DD/MM/YYYY')

Celambarasan