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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
fredericvillemi
Specialist
Specialist

Change Expression Condition with Macro VB ?

Hello,

I'm always amazed by the power of using QlikView through VB Macro but the lack of documentation and examples about it.

I'm trying to create a line chart with conditional expressions through VB (to quickly add 50 conditional expressions)

I'm able to remove all expressions

Set o = mydoc.GetSheetObject("CH349")

For i = 0 To o.GetProperties.Expressions.Count - 1

    o.RemoveExpression (0)

Next

Then I add all expressions and change a Comment

myLine = 1

While Cells(myLine, 4) <> ""

    cond = Cells(myLine, 4)

    myExpr = Cells(myLine, 19)

    o.AddExpression (myExpr)

   

    Set pq = o.GetProperties

    Set expr = pq.Expressions.Item(myLine - 1).Item(0).Data.ExpressionData

       

    expr.Comment = "test"

    o.SetProperties pq

    myLine = myLine + 1

Wend

But now I would like to change the Caption of these Expressions AND to add a conditional expression for each of them

how can I do ?

Thanks

0 Replies