Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

what is the difference variable between in Edit Script and in Variable Overview?

Hi, all

As Title,  what is the difference?

and mapping table's advantage?

Thanks

Eunduck

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Best practices dictate that variables are created as much as possible in your load script, because a load script gives you full control over this growing set of (often temporary) containers.

For instance, in a load script a variable can be created (by SETting or LETting it = somthing) and also deleted (by SETting or LETting it = NULL() or nothing). To keep your variable overview in good shape, better delete whetever variable you do not need anymore at the end of your script.

However, some variables cannot be created in your script, like a Report version variable (script independent), a switch-to-debug-mode variable or parameter variables (for passing information from the OCX control to your QVW model) because the latter must exist before a reload, and if you create them while reloading, you'll delete the passed parameter value.

And now getting to my point: variables created in the UI (variable overview) CANNOT BE DELETED in your LOAD script. They can be set to nothing, but they'll stay present in the variable overview. You'll need to delete them manually from Settings->Variable overview.

There is a great post by Henric about variables and substitution: http://community.qlik.com/blogs/qlikviewdesignblog/2013/11/04/the-magic-of-variables

Peter

View solution in original post

7 Replies
sujeetsingh
Master III
Master III

As per i know the one declared in the edit script can be used in the script but one we declare in the Variable overview is to be used in our front end expressions .

While the Variable Overview provides the complete details and list of the variables in the document.

phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

as far as i know


Variable in Edit script & Variable Overview...

Actually both are same, once you create in any place it is available through entire application... But there are advantages and disadvantages..

Adv: Adding a variable in through Variable overview doesn't need a reload of the application, which is really helpful if your reload time of your application is large...

Dis: if you want to define variable  in your script it does require a RELOAD, until then you cant use it in the applciation or in your script..

Mapping:

Mapping Load / Apply Map versus Left Join

Not applicable
Author

hi

if you define variable in Edit Script-->

use

SET (use for string) and

LET (use for calculation)

if you define variable on Dashboard-->

define value without equal to sign (use for string that is equivalent to SET)     and

define value with equal to sign (use for calculation that is equivalent to LET)

Regards

Not applicable
Author

And mapping table's advantage is, qlikview when it finishes loading eliminates that tables that are loaded used 'Mapping' Load from its data model so that data model looks simple and is easier to understand.

Not applicable
Author

more than the convenience i would think there are certain variables that can be initialised only in the script. for example max(date) from a variable needs to be assigned to a variable using peek. If we didn't do that in the script, we would have have that table just for creating the variable in the variable manager GUI. But if we do that in the script, once we create the variable, then we can remove that table in the script using the drop table statement.

Not applicable
Author

hi, Ramnath

thanks your reply.

Actually, Im not sure how to use mapping table

and

you mean

After I made a tableC by using tableA, tableB, A,B are disappeared?

also

when use mappnig table in any situation?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Best practices dictate that variables are created as much as possible in your load script, because a load script gives you full control over this growing set of (often temporary) containers.

For instance, in a load script a variable can be created (by SETting or LETting it = somthing) and also deleted (by SETting or LETting it = NULL() or nothing). To keep your variable overview in good shape, better delete whetever variable you do not need anymore at the end of your script.

However, some variables cannot be created in your script, like a Report version variable (script independent), a switch-to-debug-mode variable or parameter variables (for passing information from the OCX control to your QVW model) because the latter must exist before a reload, and if you create them while reloading, you'll delete the passed parameter value.

And now getting to my point: variables created in the UI (variable overview) CANNOT BE DELETED in your LOAD script. They can be set to nothing, but they'll stay present in the variable overview. You'll need to delete them manually from Settings->Variable overview.

There is a great post by Henric about variables and substitution: http://community.qlik.com/blogs/qlikviewdesignblog/2013/11/04/the-magic-of-variables

Peter