Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Convert IF to Set analysis

Hi All,

  How to convert the below IF expression in to Set analysis

sum(if(Periods=GetFieldSelections(Period1) and Flag1=3,[Gross Value Local Currency]))

5 Replies
devarasu07
Master II
Master II

Hi,

like this

sum({$<Periods={'$(=GetFieldSelections(Period1))'},Flag1={3}>}[Gross Value Local Currency])

or

sum({$<Periods={'$(=GetFieldSelections(Periods1))'}>+<Flag1={3}>}[Gross Value Local Currency])

Thanks,Deva

Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

Sum({<Periods=P(Period1), Flag1={3}>} [Gross Value Local Currency])

Aurélien

Help users find answers! Don't forget to mark a solution that worked for you!
Anil_Babu_Samineni

Or

sum({$<Periods={$(=Concat(Chr(39) & Period1 & Chr(39), ','))},Flag1={3}>}[Gross Value Local Currency])


Note - Second one won't work, Because + Consider in analysis as OR not AND.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
its_anandrjs

Try this

Sum({<Periods ={"$(=GetFieldSelections(Period1))"},Flag1={3} >}  [Gross Value Local Currency])


Or


Sum({<Periods ={"$(=GetFieldSelections(Period1))"},Flag1={'3'} >}  [Gross Value Local Currency])

pradosh_thakur
Master II
Master II

Hi Anand

what if more than one selections are there? will it work there too? i guess we need to modify the expression for that.

regards

Pradosh

Learning never stops.