Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Conditional enabling of expression

Hi All,

How can I enable or disable any expression based on specific Cyclic group level?

Thanks for helping me on this..

Kind Regards,

Varun

Tags (1)
1 Solution

Accepted Solutions
marcus_malinow
Valued Contributor III

Re: Conditional enabling of expression

Hi Varun,

you don't need the If condition, just

GetCurrentField([Bu Mix]='Business Unit'

This will return a Boolean, which is what the conditional show requires

8 Replies
jsingh71
Valued Contributor

Re: Conditional enabling of expression

Go to chart Properties and then Expression tab.

Select the expression which you want to enable or disable based on the condition and then checck the conditional check box and then mention condition.

condition.png

Re: Conditional enabling of expression

Yes, you can use the getcurrentfield function to find out which field is the active one in the cyclic group:

if(getcurrentfield(MyGroup)='Product',1,0)


talk is cheap, supply exceeds demand
Not applicable

Re: Conditional enabling of expression

Thanks Wassenaar,

Is there a way to find out MyGroup name? My cyclic group is a dimension named as 'BU Mix' but it not working with that.

=if(getcurrentfield(Bu Mix)='Product',1,0)

Kind Regards,

Varun

marcus_malinow
Valued Contributor III

Re: Conditional enabling of expression

Hi Varun,

try

getcurrentfield([Bu Mix])='Product'

(note the square brackets around the group name)

Not applicable

Re: Conditional enabling of expression

I think we are close :

Single quotes seem to be working for identifying MyGroup but now facing another problem,

I have tried using two options and both the options are disabling expression at all cyclic levels

=if(GetCurrentField('Bu Mix')='Business Unit',1,0)

=if(GetCurrentField('Bu Mix')=[Business Unit],1,0)

Kind Regards,

Varun

marcus_malinow
Valued Contributor III

Re: Conditional enabling of expression

Hi Varun,

you don't need the If condition, just

GetCurrentField([Bu Mix]='Business Unit'

This will return a Boolean, which is what the conditional show requires

Not applicable

Re: Conditional enabling of expression

Just now tried without If and same result. It is disabled at all levels.

Thank you Marcus

Not applicable

Re: Conditional enabling of expression

Hi Marcus, Now it worked.

I used following condition :- GetCurrentField([BU Mix])='Business Unit'

Thank you so much everyone for help

Community Browser