Qlik Community

Qlik Sense App Development

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

mgarcmun
New Contributor

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
mgarcmun
New Contributor

Re: Dynamic aggregation in a variable

Could someone help me, please?

thanks.

dwforest
Valued Contributor

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'

     )

)