Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

Cleaning up variables

Hi,

I am always trying to keep my QlikView_apps slim and tidy and understandable for outsiders.

One thing that has been bothering me is variables that are not needed anymore or are not even part of the code anymore, but that have been created at some time or other and are still around there.

=> Is there any way to delete variables after they have been used?

Thanks a lot!

Best regards,

DataNibbler

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Goto edit script->Settings(tab - the left bottom)->Check 'Can Execute External Programs'

View solution in original post

15 Replies
Anonymous
Not applicable

Hello.

Yes, you can delete variables that you won't need anymore. Just use:

Set variable = ;

There's one caveat. It only work for variables that were created for the first time in the script. If the variables are already in the Variable Overview, you'll need to delete them there first.

Regards.

datanibbler
Champion
Champion
Author

Thanks Bruno!

I'll try that out immediately. Can I also clean up files (qvd) that I have created in the process?

tresesco
MVP
MVP

Try like:

Execute CMD.EXE /C del "qvdname.qvd";

datanibbler
Champion
Champion
Author

Hi tresesco,

that sounds promising. I was supposing you could do some cool things with that EXECUTE command, but honestly I'm not good at working in the command line.

Thanks a lot!

I'll try.

datanibbler
Champion
Champion
Author


Hi tresesco,

I am getting an error that the command may not be executed because I don't have the access_rights. I wonder why - the file I want to delete is on the QlikViewServer which I have RW access to.

Do I have to specify the complete file_path? I guess I do ...

P.S.: Well, I still got the error, but this time round I clicked on OK and the command was executed anyway. Of course there's no way I can manually execute the script in the time_interval we need and click on OK at this point every time.

=> Is there any way I can pass something like the /f (force) option?

tresesco
MVP
MVP

Goto edit script->Settings(tab - the left bottom)->Check 'Can Execute External Programs'

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Yes, you have to specify a path to every QVD (you can use variables to make that more flexible). Otherwise, the reload engine will try to find those QVD's in the directory where the QVW model resides (User Documents), or where you were after the last Directory; script statement.

datanibbler
Champion
Champion
Author

Hi tresesco,

that worked.

I got a dialog_field once, but now it seems the script runs without asking.

Thank you!

datanibbler
Champion
Champion
Author


O_O - I still get that dialog_window and have to confirm that I want to run the script with access to external files ...