Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
pepe2209
Creator
Creator

Two actions (macro and setvariable) in one button problem.

Hello

I have the following problem. I have created a analysis app in which via buttons multiple graphs can be shown.

So the standard action for a button is: setvariable: if(vVariable='hide', 'show', 'hide').

And the visibility of the graphs are dependent on the value 'show' for this vVariable.

But now I have multiple buttons with also a set of (different) graphs connected to them. So now I want to add an action to each button in front of the original action which sets all vVariables to 'hide' so I dont get overlapping charts.

I can do this with the next macro:

sub HideGraphs

       

        Set vVariable1  = ActiveDocument.Variables("vVariable1")

        vVariable1.SetContent "hide", true

etc...

end sub

The problem is that the two actions:      first macro (all vVariables to hide)

                                                          second setvariable (show vVariable)

do not work chronologically it appears. Only the macro for hiding works and the order in which the actions are placed does not matter. I never get to see the graphs that should be shown.

Does someone have an idea to fix this? maybe by adding a short delay between both actions or something?

ps. Working with automatic minimize for each individual graph does not work when you want make graphs show and hide in groups.

Thanks

1 Solution

Accepted Solutions
Gysbert_Wassenaar

My guess would be that the macro action is always executed last. That means you can try using only macro actions or only Set Variable actions. If you show/hide charts in groups you need only one variable and use a different value per group to determine which group to show. To show group1 it would for example get the value 'Group1' and the conditional expressions for the group1 chart would be =match(vShow, 'Group1'). For the second group it could be =match(vShow, 'Group2')


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

My guess would be that the macro action is always executed last. That means you can try using only macro actions or only Set Variable actions. If you show/hide charts in groups you need only one variable and use a different value per group to determine which group to show. To show group1 it would for example get the value 'Group1' and the conditional expressions for the group1 chart would be =match(vShow, 'Group1'). For the second group it could be =match(vShow, 'Group2')


talk is cheap, supply exceeds demand
pepe2209
Creator
Creator
Author

@ G. Wassenaar

Aah yes off course the solution is much simpler. I only used show and hide values for each vVariable....

Thanks this will work