Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
MauriceLudo
Creator II
Creator II

Variable Excel

Hello,
I show you my idea, I Would you my terms of fattening and expressions analysis in Excel File Not With Variables, and then my recharger Initiation and Variables USE In My objects, but I can not part Manage aside reload QlikView, somebody can explain to me the process please e a small example application.
Thank you for your help
Regards,
Maurice

1 Solution

Accepted Solutions
adamdavi3s
Master
Master

No this is not correct, that load script will automatically loop through and create all 1500 variables.

Maurice please see here for the example from Qlik IT

Managing Variables

View solution in original post

7 Replies
vardhancse
Specialist III
Specialist III

Hi,

First create variable in dashboard:

Ctrl+Alt+v, create new variables.

Change expressions to variables

now create input box object and select expressions variables and export to excel

out of 3 columns delete "=" column and use below mentioned script to load the variables by giving appropriate path

Formulas:

LOAD Variable,

     Formula

     //Remarks

FROM

\\Desktop\Variables.xlsx

(ooxml, embedded labels, table is VariablesTab);

Let vNumberOfRows = NoOfRows('Formulas');

For vI = 0 to (vNumberOfRows - 1)

Let vVariable_Name = Peek('Variable',vI,'Formula');

Let [$(vVariable_Name)] = Peek('Formula',vI,'formula');

Next

MauriceLudo
Creator II
Creator II
Author

Thank you very much  Sasi  V Kandragula,

Let vVariable_Name = Peek('Variable',vI,'Formula');

Let [$(vVariable_Name)] = Peek('Formula',vI,'formula');

Next

.

.....

I have to declare every variable here, I almost 1500 variable (expression)

vardhancse
Specialist III
Specialist III

Yes we need to declare all  expressions(Variables) in our dashboard.

MauriceLudo
Creator II
Creator II
Author

In script? I can also declare in text file that reference the Excel file

adamdavi3s
Master
Master

No this is not correct, that load script will automatically loop through and create all 1500 variables.

Maurice please see here for the example from Qlik IT

Managing Variables

vardhancse
Specialist III
Specialist III

If we place all variable sin excel sheet and load above mentioned script

Let vNumberOfRows = NoOfRows('Formulas');

For vI = 0 to (vNumberOfRows - 1)

Let vVariable_Name = Peek('Variable',vI,'Formula');

Let [$(vVariable_Name)] = Peek('Formula',vI,'formula');

Next

It will load all 1500 variables..not required any code change or manual declaration of each variable.

MauriceLudo
Creator II
Creator II
Author

Thank you very much Adam