Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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
MVP & Luminary
MVP & Luminary

Re: Update and assign variable in Macro

Try this:

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

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

- Marcus

Not applicable

Re: Update and assign variable in Macro

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.

MVP & Luminary
MVP & Luminary

Re: Update and assign variable in Macro

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

var = var + 1

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

- Marcus

Not applicable

Re: Update and assign variable in Macro

Great.. Thanks Marcus