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: 
Anonymous
Not applicable

Variables in Macro

Dear all,

I am trying to trigger a macro to change the value of a variable (v_sortIndex) and its not working.

You can see below how im doing:

Sub por

If v_sortIndex = 2 Then

v_sortIndex = 1

End if

Thanks in advance,

Filippo

5 Replies
m_woolf
Master II
Master II

This is from the API Guide:

set v = ActiveDocument.Variables("Variable1")

if not v.GetContent.IsNum then

    msgbox(v.GetContent.String)

end if

set v = ActiveDocument.GetVariable("Variable1")

v.SetContent "123",true

Anonymous
Not applicable
Author

What about the values (2, 3...)?

m_woolf
Master II
Master II

This can be done with a macro, but why not just use an action?

Anonymous
Not applicable
Author

How? I want to that command to verify the value of a variable. If it's 2, then a i want to change to 1...

How can I do that if a action?

Thanks in advance

m_woolf
Master II
Master II

How does your variable gets it's value in the first place?