Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
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

Highlighted
Contributor III
Contributor III

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

Highlighted
Master II
Master II

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

Highlighted
Contributor III
Contributor III

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

Highlighted
Master II
Master II

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