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

Update and assign variable in Macro

Hi

I woud like to increment a variable 'vIncr' in Macro definition and assign the resulting value to another variable 'vLatest'. Please help me in achieving this. Thanks in advance...

4 Replies
marcus_sommer

Try this:

var = ActiveDocument.Variables("var1").GetContent.String

ActiveDocument.Variables("var2").SetContent var, true

- Marcus

Not applicable
Author

Hi Marcus

I want to first increment the value of variable before assigning it to another variable. Main question is : how to increment the value of variable by 1.

marcus_sommer

var = ActiveDocument.Variables("var1").GetContent.String

var = var + 1

ActiveDocument.Variables("var2").SetContent var, true

- Marcus

Not applicable
Author

Great.. Thanks Marcus