Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
filippo_cardoso
Contributor III
Contributor III

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

filippo_cardoso
Contributor III
Contributor III
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?

filippo_cardoso
Contributor III
Contributor III
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?