Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Macro Help

..

4 Replies
diegofcaivano
Contributor

Re: Macro Help

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

Re: Macro Help

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
Contributor

Re: Macro Help

Chris,

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

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

Cheers,

Diego.-

Not applicable

Re: Macro Help

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