Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable issue

how to use same variables from one application to another application??

5 Replies
Anonymous
Not applicable
Author

make use of include files

for instance you can define variables for Colors etc. and use it in every app

no Need to define them over and over

jjordaan
Partner - Specialist
Partner - Specialist

vcanale
Partner - Creator II
Partner - Creator II

Hi,

You can define the variables in a separate file and then Include (or even better Must_Include) the file in the several  applications where you need to use the same variables.

$(Include =filename )

$(Must_Include =filename )

**The difference between include and must_include is that "Include" will fail silently if the file is not found during script reload, while "Must_Include" will throw an error if the file is not found.

maximiliano_vel
Partner - Creator III
Partner - Creator III

Try Using QDF (QlikView Deployment Framework).

QlikView Deployment Framework

Not applicable
Author

hi store variables in an excel sheet with three columns

Name, Expression and Comment

Name should contain name of variable example vCY_ACT_IS and Expression should be the variable expression but without = sign. example rgb(9,23,56) or sum(Sales).

now load excel file with script below…..

Temp_Variables:
LOAD Name,
      Expression,
      Comment
FROM
[..\0.Includes\Variables.xlsx]
(ooxml, embedded labels, table is Variables);


// Creating variables
for i = 0 to NoOfRows('Temp_Variables') - 1

   let vName = peek('Name', i, 'Temp_Variables'); // Name of the variable
  let vComment = peek('Comment', i, 'Temp_Variables'); // Comment/description of the variable
  let $(vName) = peek('Expression', i, 'Temp_Variables') & chr(10) & '/* $(vComment) */'; // Expression

next i


//////// Removing temp variables
let i = null();
let vName = null();
let vComment = null();

//////// Removing temp tables
drop table Temp_Variables;

Cant remember where I had gotten this script but Ive found it very useful! hope it helps