Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Converting if to Set Analysis

Dear Champs,

How can I convert the following if statement to set analysis.

Sum(if(DATE>=num(MonthStart('$(Variable)')) and DATE <=num(MonthENd('$(Variable)')) ,  AMOUNT))

Thanks in Advance

DERIK

1 Solution

Accepted Solutions
MayilVahanan

Hi

    Try like this

    Sum ({<DATE  = {">=$(=MonthStart(Min(FIELD)))<=$(=MonthStart(Max(FIELD)))"}>}Amount)

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

5 Replies
Not applicable
Author

Dear,

Derik.

i think it's better if you create two variables

v1=Num(Monthstart(field))

v2=num(MonthEnd(field))

Expression:

SUM( {$<DATE = {">=$(#v1) <=$(#v2)"} >} AMOUNT)

Thanks,

Mukram.

Not applicable
Author

Thanks Mukram,

But I don't want to create a variable. Becoz I have 30expression, creating variable willl be tough.

DERIK

Not applicable
Author

Hi Derik,

Try the below Expression:

Sum ({<DATE  = {">=$(=Num(MonthStart(Min(FIELD))))<=$(=Num(MonthStart(Max(FIELD))))"}>}Amount)

Regards,

Desmortes

somenathroy
Creator III
Creator III

Try with this:

Sum( {< DATE = {' >= $(=Num(MonthStart("$(Variable)"))) <= $(=Num(MonthEnd("$(Variable)")))'} >} AMOUNT)

MayilVahanan

Hi

    Try like this

    Sum ({<DATE  = {">=$(=MonthStart(Min(FIELD)))<=$(=MonthStart(Max(FIELD)))"}>}Amount)

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.