Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
marcorizzo
Contributor III
Contributor III

export script into txt file

Hi everybody.

I've got this need.

I would like to export all the script of my qlikview file into a txt file.

What do you suggest me ?

Thanks

1 Solution

Accepted Solutions
felipedl
Partner - Specialist III
Partner - Specialist III

Forgot to mention that the script is generating the file into "C:\Script\Test.txt"

You have to create the folder or change it in the macro section in qlivkiew "Tools -> Edit Module";

Use the attached QVW.

Felipe.

View solution in original post

11 Replies
marcorizzo
Contributor III
Contributor III
Author

Is there a command in the script that I can use in the top of the script for my need ?

felipedl
Partner - Specialist III
Partner - Specialist III

Hi Marco,

When you enter the script editor (CTRL+E), theres an option, under File -> Export to Script File that makes what you need.


This will export it to a qvs file or txt.

Felipe.

marcorizzo
Contributor III
Contributor III
Author

Nice but I'd like to automatize this operation.

Is there a syntax that I can use in the top of the script to export the whole script below ?

P.S. Sorry for my English

felipedl
Partner - Specialist III
Partner - Specialist III

Hi Marco,

See the attached QVW.

It uses a macro, as follows:

sub writeScriptToFile

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.OpenTextFile("C:\Users\eferibe\Desktop\Test.txt", 2,True)

objFile.Write(ActiveDocument.GetProperties.Script)

objFile.Close()

end sub

You can create a task (if you have Qlik Server) to automate the task.

Felipe.

marcorizzo
Contributor III
Contributor III
Author

What do you think if the txt result is this:

///$tab Main

???

felipedl
Partner - Specialist III
Partner - Specialist III

It's a comment that's just stating in which tab it is.

I've added two more tabs, and it's the same for the others, so you can differentiate between the tabs in Qlikview.

It's just a tag actually.

Felipe.

Not applicable

Hi Marco,

Try this Macro, you should change the path used in the variable.

After saving the macro, you can create a button to execute it.

felipedl
Partner - Specialist III
Partner - Specialist III

Forgot to mention that the script is generating the file into "C:\Script\Test.txt"

You have to create the folder or change it in the macro section in qlivkiew "Tools -> Edit Module";

Use the attached QVW.

Felipe.

marcorizzo
Contributor III
Contributor III
Author

which is the variable I have to change ?

Thanks