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

Macro Help

..

4 Replies
diegofcaivano
Partner - Creator
Partner - Creator

Hi. I would recommend you to keep the VBScript code as light and simple as possible, so try to calculate the result in a QlikView variable first.

In this case create a new variable:

=[Field 1] & PURGECHAR($(Variable1), '/') & [Field 2] & CHR(13)

The 'Carriage Return' here is the 13th ASCII non-printable character.

Regards.

Not applicable
Author

Hi Diego,

To do so, i declared a variable in my scipt, but how can i use it in the macro

Something like

x = vName

msgbox vName

doesn't display my variable

I hope you can help

best regards

chris

diegofcaivano
Partner - Creator
Partner - Creator

Chris,

To get a QlikView variable at macro runtime, you need:

ActiveDocument.Variables("vName").GetContent.String

Cheers,

Diego.-

Not applicable
Author

Diego,

Thank you very much for your quick answer.

Do you know how i can add a suffix to a filename.

I use Filename = ActiveDocument.Evaluate("replace(documentname(), '.qvw', '.xml')")  to get a .xml file named after qvw but i'd like to add a country code like DocName_FR.xml, DocName_SP.xml  according to the selected country.

best regards

Chris