Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
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

1 Solution

Accepted Solutions
marcus_malinow
Partner - Specialist III
Partner - Specialist III

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

View solution in original post

8 Replies
jsingh71
Partner - Specialist
Partner - Specialist

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

Gysbert_Wassenaar

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
Author

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
Partner - Specialist III
Partner - Specialist III

Hi Varun,

try

getcurrentfield([Bu Mix])='Product'

(note the square brackets around the group name)

Not applicable
Author

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
Partner - Specialist III
Partner - Specialist III

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
Author

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

Thank you Marcus

Not applicable
Author

Hi Marcus, Now it worked.

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

Thank you so much everyone for help