Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to Create Context Variables in the Repository

Context variables are user defined variables that can be changed at runtime with different parameters and are a fantastic way to save time and help with collaboration among developers. These variables can be set with different values based on the environment they are run in (For example: test vs production), making it so you don’t have to build the same job more than once. These variables can be created within the job itself, or in the repository as metadata.

 

To create context variables in the repository you need to go into the repository and right click “Contexts”. This will allow you to create a new context group where you can give it the appropriate name, purpose, and description.

 

0683p000009LsZc.png

0683p000009LsIM.png

Once you fill out the context group details you can use the green plus sign at the bottom left of the window, where you can choose to add new context variables for your group. Once you have added a new context variable, create a name for your context variable, the data type, any comments you may want to add about your variable, as well as, a value.

 

Using the plus sign closer to the top right of the window will allow you to add different environments for your variable. Bellow, I created two different environments, “Production” and “Test”, with “Test” being set as the “Default”. Being a “Default” simply means that, if not specified, the value under the “Test” environment will be used for the context variable.

 

0683p000009Lsd5.png0683p000009LsbT.png

 

Now that you have created your context variable group you can find them in the same place you created them, the Repository. From there you can simply click and drag them onto the canvas to add them to your job, or you can select the “Contexts” tab in the Configuration tab section, then click on the context variable icon at the bottom left corner. In the tab you can also change the “Default context environment.” Don’t forget you can also reuse these variables as many times as you need to for multiple jobs.

 

0683p000009LsID.png

Labels (1)
  • v6.x

2 Replies
Anonymous
Not applicable
Author

Hello,

Thanks for sharing it on forum.

Best regards

Sabrina

Anonymous
Not applicable
Author

A description of the error. This variable is cleared upon entering a step, and is set when an error occurs during step operation. This variable can only be used in the next step condition. The ErrorDescription is also saved in the C.sys.LastErrorDescription and this value is not cleared. For more information about this variable and  CCleaner   Happy Wheels  VLC