IntroductionA script variable can be used to set the environment. In a QlikView application, variables are applied after the script executes. The variables are used before the script execution and are dropped after the script execution. For script variables there is no inherent function and no specific command.The following is the basic procedure for using script variables in a QlikView application.Step 1: Open the QlikView applicationIn this step you need to open the QlikView application then go to File-> New then this window will be opened.Step 2: Open edit scriptThe second step is to open the edit script window.Then, this window will be opened. Step 3: Code of edit script and reload itThen, write this code in the edit script. Step 4: Save fileThe next step is to save our QlikView file in the location you want and click on the Save button.ExampleHere I used the two variables Date and Time that shows the current date and time and also explains how to use script variables.Step 5: Sheet property windowThere is no field to open because we did not upload any table and database. So simply click on the OK button.Step 6: Select text objectNow right-click anywhere in the blank main sheet and select:New Sheet Object->Text Object, then the window will be opened.Step 7: New text object windowIn this window, we provide the text of our variable that we declared in the edit script window then click on the OK button.This window will show the current date.Step 8: Select another text objectAgain, right-click anywhere in the blank main sheet and select:New Sheet Object->Text Object, then the following window will be opened.Step 9: Again a new text object window will be openedIn this window, we provide the text of our variable that we declared in the edit script window then click on the OK button.This window will show the current time.Step 10: In the variable overview you can check these variables, Setting->Variable overview.Now you will see this window. Here you can see both script variables with definition and click on the OK button.Step 11: Drop script variableFor dropping any variable, we should provide a null value to the script variable. If you want to drop a variable after script execution then again open the edit script and you need to write this code and reload it.ExampleSuppose you want to drop a date variable, then you should provide a null value for the date variable.Step 12: Sheet property windowThere is no field to open because we did not upload any table and database. So simply click on the OK button.This window will show the drop date variable.Step 13: In the variable overview you can check these variables, Setting->Variable overview.Now you will see this window. Here you can see a drop script Date variable. There is no definition for any drop script variable and click on the OK button.If you want drop a Time variable then you need to use the same process with the Time variable.SummaryThis article is very simple to understand. It provided basic concepts of Script variables and also introduced how to use script variables before executing a script and how to drop them.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: