Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Attend QlikWorld 2020 and hear keynote speaker, Malcolm Gladwell. Register by February 29th to save $200. Learn More
Highlighted
rajender_qlik
Contributor

Macro for Disabling the conditional for expressions in chart

Hello,

I am looking for macro to disable only conditional expression in a chart but keeping the expression enable.

If anyone has the macro please keep posted here.

I have found macro in API guide for enabling the condition where as I am looking to disable the existed condition for expression

rem create new macro button

set newbutton = ActiveDocument.ActiveSheet.CreateButton

set prop = newbutton.GetProperties

prop.Type = 2    

prop.Text.v = "Run macro a"

prop.Macro = "a"

prop.EnableCondition.v = "count(Regions)<2"

newbutton.SetProperties prop

Thanks in Advance !!

Rajender

1 Solution

Accepted Solutions
Highlighted
rajender_qlik
Contributor

Re: Macro for Disabling the conditional for expressions in chart

Thanks for the reply m w.

Yes I have tried but that didn't work. I have tried in another way and found the solution.

set expr = p1.Expressions.Item(1).Item(0).Data.ExpressionData

expr.Definition.v = "count(Regions)<2"

set expr = p1.Expressions.Item(1).Item(0).Data.EnableCondition

expr.Type =  1  '1-Disable, 2- Clear

expr.Expression = ""

This Macro code helps to enable the expression and disables the conditional when you run it.

View solution in original post

2 Replies
Highlighted
mwoolf
Honored Contributor II

Re: Macro for Disabling the conditional for expressions in chart

Have you tried:

prop.EnableCondition.v = ""

Highlighted
rajender_qlik
Contributor

Re: Macro for Disabling the conditional for expressions in chart

Thanks for the reply m w.

Yes I have tried but that didn't work. I have tried in another way and found the solution.

set expr = p1.Expressions.Item(1).Item(0).Data.ExpressionData

expr.Definition.v = "count(Regions)<2"

set expr = p1.Expressions.Item(1).Item(0).Data.EnableCondition

expr.Type =  1  '1-Disable, 2- Clear

expr.Expression = ""

This Macro code helps to enable the expression and disables the conditional when you run it.

View solution in original post