Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
lucarizziero
Partner - Contributor III
Partner - Contributor III

Clear/Delete a variable

Hi all,

I use some variables inside the load script, but I'd need to delete them after the loading has finished.

Thanks

1 Solution

Accepted Solutions
Anonymous
Not applicable

LET varname=null();

View solution in original post

12 Replies
Not applicable

If your familiar with macro's you can write one that says var = ''.

Anonymous
Not applicable

LET varname=null();

lucarizziero
Partner - Contributor III
Partner - Contributor III
Author

Hi James,

I know: but doing so I still have those variables inside the variable list of the Document Properties ! is it possible to remove them ?

Anonymous
Not applicable

Oh, and I have to add that if you got these variables on the front end already, make sure to delete them manually. After this the =null() will prevent creating variables on the front end.

Regards,
Michael

Not applicable

The manual states:

'all variables used in the script are copied out to layout variables at the end of script execution.'

so I assume this means you would have to manually delete them after reloading the document (each time).

I wouldnt have thought they take up much space though - why worry about them?

Regards,

Gordon

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If the variable was created in the script, and it is empty, it will not be copied out to the layout.

So a script created variable can be deleted either with:

LET v=null();
SET v=;

They may not take up much space, but I find that they do clutter up the variable overview and con sometimes complicate understanding the app.

-Rob

Not applicable


Rob Wunderlich wrote:
If the variable was created in the script, and it is empty, it will not be copied out to the layout.
So a script created variable can be deleted either with:
LET v=null();
SET v=;
They may not take up much space, but I find that they do clutter up the variable overview and con sometimes complicate understanding the app.
-Rob<div></div>


Hi rob,

I used this in QlikView 8.5 ... but when trying this in QlikView 9 neither LET v=null(); nor SET v=; works ...
Does this work for you in QlikView 9 (SR1) or am I missing something?

Best regards

Stefan

Anonymous
Not applicable

Stefan,
(I'm no Rob, but your message is not exactly private...)

It works for me in QV9, and I don't use SR1 yet. Did you try to delete your variables manualy on the front end? If they exist already, script is not going to remove them.

Not applicable


Michael Solomovich wrote:
Stefan,
(I'm no Rob, but your message is not exactly private...)

It works for me in QV9, and I don't use SR1 yet. Did you try to delete your variables manualy on the front end? If they exist already, script is not going to remove them. <div></div>


Hi,

yes, sure deleting the variables manually works as expected; but it does not work in the load script by setting the variable to null as described above ...

Best regards
Stefan