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: 
cesaryulgon
Contributor II
Contributor II

use of variables in editor module (macro)

hi
I need to read a variable and execute addition, subtraction or multiplication to itself and return the result to the same variable.
thanks for the help
Labels (1)
  • Other

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The QV COM API Guide available here 

https://help.qlik.com/en-US/qlikview-developer/April2019/Subsystems/Automation/Content/QV_Automation...

has details on working with variables.  Basically it's:

Set var = ActiveDocument.GetVariable("varname")  'gets a Variable object

content = var.GetContent.String  'gets variable content

var.SetContent newvalue 'sets variable value

You will probably have to convert the string to number first if you want to do arithmetic. 

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

View solution in original post

4 Replies
Sue_Macaluso
Community Manager
Community Manager

@cesaryulgon Hi, are you using Qlik Sense or View? I would like to move this into the correct product forum. Thanks

Did you find a solution to your question? Mark the solution as accepted : and if you found it useful, press the like button!
cesaryulgon
Contributor II
Contributor II
Author

Qlikview.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The QV COM API Guide available here 

https://help.qlik.com/en-US/qlikview-developer/April2019/Subsystems/Automation/Content/QV_Automation...

has details on working with variables.  Basically it's:

Set var = ActiveDocument.GetVariable("varname")  'gets a Variable object

content = var.GetContent.String  'gets variable content

var.SetContent newvalue 'sets variable value

You will probably have to convert the string to number first if you want to do arithmetic. 

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

cesaryulgon
Contributor II
Contributor II
Author

Thank you very much for the contribution