Qlik Community

Qlik Sense App Development

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

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
mgarcmun
New Contributor II

Dynamic aggregation in a variable

Hi!

I'm created a master dimension (Customer Range) throught a measure.

And I want to show the following expression:

if(aggr(sum(Sales),Customer)*100<0,'Option1',

     if(aggr(sum(Sales),Customer)*100>=0 AND aggr(sum(Sales),Customer)*100<0,

          'Option2',

          'Option3'

     )

)

Once the dimension is created, if I filter by 'Option1' (for example) the dashboard is filtered. Now, if I filter by other field (for example: customer type = pyme). I can see the data filtered by Customer Range = Opcion1 (i.e. Customers whose sales are less than zero) and Customer Type = PYME, but Customer Range dimension is recalculated and Customer Range dimension may not show only the 'Option1'.


Once field value filtered, could I do something so that it's not recalculated?

Is posible create a dynamic aggregation in a variable?

Thank you very much in advance!

Best Regards.

2 Replies
Highlighted
mgarcmun
New Contributor II

Re: Dynamic aggregation in a variable

Could someone help me, please?

thanks.

Highlighted
dwforest
Valued Contributor II

Re: Dynamic aggregation in a variable

Not clear exactly what you are trying to do, but I think Set Analysis will get you there.

It sounds like you want the selection of Customer Type to be ignored for the "Option" calculation.

if(aggr(sum({<[Customer Type]=>}Sales),Customer)*100<0,'Option1',

     if(aggr(sum({<[Customer Type]=>}Sales),Customer)*100>=0 AND aggr(sum({<[Customer Type]=>}Sales),Customer)*100<0,

          'Option2',

          'Option3'

     )

)