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: 
Fl_Scn
Contributor
Contributor

If condition to set analysis

Hi there,

is it possible to convert this to set analysis? 

 

Sum (If(Year(INVOICEDATE)=2018 and INVOICEDATE <= AddMonths(today()-1,-24), SALES))

 

Thank You!

Labels (1)
1 Solution

Accepted Solutions
menta
Partner - Creator II
Partner - Creator II

Sum ({<INVOICEDATE={">='01/01/2018' <= $(=Date(AddMonths(today()-1,-24)))  "}>} SALES)

 

To use Year(INVOICEDATE) you need to create an Year field in script, in this case you can use this

 

SUM({<Year={2018}, INVOICEDATE={"<= $(=Date(AddMonths(today()-1,-24))) "}>} SALES)

 

View solution in original post

1 Reply
menta
Partner - Creator II
Partner - Creator II

Sum ({<INVOICEDATE={">='01/01/2018' <= $(=Date(AddMonths(today()-1,-24)))  "}>} SALES)

 

To use Year(INVOICEDATE) you need to create an Year field in script, in this case you can use this

 

SUM({<Year={2018}, INVOICEDATE={"<= $(=Date(AddMonths(today()-1,-24))) "}>} SALES)