Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro for Conditional expression in chart

Hi All

I am creating the chart from Macro and also added the dimension and expressions.

Sub FunctionStraightTable

  set myStraightTable=ActiveDocument.ActiveSheet.CreateStraightTable

  GetDimName = ActiveDocument.Variables("vDim").GetContent.String

  myStraightTable.AddDimension GetDimName 

GetMeasureName = ActiveDocument.Variables("vMeasure").GetContent.String

  myStraightTable.AddExpression GetMeasureName

end sub

Now i want to make the expression conditional. How can i enable the conditional option from Expression Tab of Chart Property and how can i write the condition.

if anybody have idea then pls let me no.

Thanks in advance !!

3 Replies
AbhijitBansode
Specialist
Specialist

Not sure how to enable or disable expression condition using script.

But a workaround could be, set the value of expression to zero to disable it.

marcus_sommer

Have a look on this example from APIGuide.qvw:

set chart=ActiveDocument.GetSheetObject("CH01")

set cp=chart.GetProperties

set dims=cp.Dimensions

set expr=cp.Expressions.Item(0).Item(0).Data.ExpressionData

dims(0).Show.Type=1 '0=false, 1=true, 2=cond

expr.Show.Type=2

expr.Show.Expression="sum(a)<10000"

chart.SetProperties cp

- Marcus

Not applicable
Author

why u need to write macro to create straight table?