Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

prasadmundewadi
New Contributor III

IF works but Set analysis does not work??

Hi

I have below expression in my app where i have used IF:

Sum(distinct If(If([Booking Amount] > $(vTopDecile) ,'Y','N')='Y',[Booking Amount],0))

The variable vTopDecile is defined as

fractile(total Aggr(Sum([Booking Amount]),[Opportunity Number],Segment), 0.9)

Now I am trying to write the same expression (the 1st one) using set analysis but that is not working. It always returns 0:

Sum({<[Booking Amount] = {"> $(=vTopDecile)"}>}[Booking Amount])

Can anybody tell me why?

Is it because fractile cannot work with Set Analysis?

Thanks, Prasad

5 Replies

Re: IF works but Set analysis does not work??

Can you try this (Make sure you don't have space between > and $(

Sum({<[Booking Amount] = {">$(=vTopDecile)"}>}[Booking Amount])

or this

Sum({<[Booking Amount] = {">$(=$(vTopDecile))"}>}[Booking Amount])

dwforest
Valued Contributor

Re: IF works but Set analysis does not work??

It could be is Segment changes for each record. Set Analysis is evaluated once per chart/visualization, not row for row.

prasadmundewadi
New Contributor III

Re: IF works but Set analysis does not work??

1st expression still give 0 but the 2nd one returns value which is wrong.

Digvijay_Singh
Honored Contributor III

Re: IF works but Set analysis does not work??

Your IF has distinct in the aggregation, may be thats making difference -

Sum(distinct {<[Booking Amount] = {">$(=$(vTopDecile))"}>}[Booking Amount])

Re: IF works but Set analysis does not work??

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

Community Browser