Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Different expression when dimension is changed

Hi all,

I create a able with a drill down dimension and i would like to change the expression when using the drill down.

Is there any way to handle?

Thanks a lot.

Best Regards,

Louis

7 Replies
siddharth_s3
Partner - Creator II
Partner - Creator II

Try something like:

IF(Getselectedcount(Dimensionx) >0, Measure2, Measure1)

Replace Dimension and measures with your own.

jonathandienst
Partner - Champion III
Partner - Champion III

Use GetCurrentField() to see the currently active level of the drill down. For example:

If(GetCurrentField('ddGroup') = 'Level1', <expression 1>, <expression 2>)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Hi Jonathan,

There is no function call GetCurrentField() in Qlik Sense....


Best regards,

Louis

Anonymous
Not applicable
Author

Hi Siddharth,

There are 4 layers in the drill down dimension, second layer with only 1 value,

therefore, it will driil down automatically to layer 3.

In this scenario, the expression you provided will be incorrect.

Is there any other way or can we disable the automatic drill down?

Best regards,

Louis

hacr
Creator
Creator

I made something similar last year, and trying to find my code. As far as I remember, I made a lot of IF statements, counting the available members in each layer of the drill down (some of the layers had fixed amount, letting me know where in the drill down I was). So look into GetPossibleCount() and the other field functions.

https://help.qlik.com/en-US/sense/September2017/Subsystems/Hub/Content/ChartFunctions/FieldFunctions...

siddharth_s3
Partner - Creator II
Partner - Creator II

As Hans says, you will have to use a combo of getselectedcount and getpossiblecount to achieve this.

agigliotti
Partner - Champion
Partner - Champion

take a look at https://qlikcommunity.qliktech.com/thread/175159

maybe it can help you.