Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

tiklam_dynasys
Contributor

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
Contributor

Re: Different expression when dimension is changed

Try something like:

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

Replace Dimension and measures with your own.

MVP
MVP

Re: Different expression when dimension is changed

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

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

tiklam_dynasys
Contributor

Re: Different expression when dimension is changed

Hi Jonathan,

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


Best regards,

Louis

tiklam_dynasys
Contributor

Re: Different expression when dimension is changed

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-sds
Contributor

Re: Different expression when dimension is changed

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
Contributor

Re: Different expression when dimension is changed

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

agigliotti
Honored Contributor II

Re: Different expression when dimension is changed

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

maybe it can help you.

Community Browser