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: 
helen_pip
Creator III
Creator III

Can you use a nested variable when improrting variables from an Excel file

Hello

I have decided to load all my variables in from a spreadsheet as it was suggested as best practice

Most variables are working just fine through this technique, however the ones which are failing to return results are the variables which have variables within them

I.e.    

=Time(Fractile({$<FactDate = {">=$(=v_Start_Date_ED)<=$(=v_End_Date_ED)"}>}[Total Wait],0.95)/1440, 'hh:mm')

v_Start_Date_ED and v_End_Date_ED are also variables, and I was wondering why my entire variable was not working?

Could someone kindly let me know if you can refer to a variable within a variable when laoding in from a spreadsheet using the following code:

 

// Load Expressions to variable for user simplicity
// *** MOD This table was move to the User Interface load

Expressions:
LOAD Variable,
Expression,
Usage
FROM

(
biff, embedded labels, table is [Sheet1$]);

Let vNumberOfRows = NoOfRows('Expressions');
For vI = 0 to (vNumberOfRows - 1)
Let vVariable_Name = Peek('Variable',vI,'Expression');
Let [$(vVariable_Name)] = Peek('Expression',vI,'Expression');
Next

Kind Regards

Helen

11 Replies
helen_pip
Creator III
Creator III
Author

Hello Marcus

Thank you for your suggestion....I have got this working by adding FactDateNum field to my fact table and then by variables and master calender are working off the FactDateNum field

Thank you for all your help


helen_pip
Creator III
Creator III
Author

Hello Peter

Thank you for your response

I have got my variable working by going back to my original sourse and adding a FacDateNum field.   My variables all now included FactDateNum fields instead and it appears to be working O.K for me

I would like to thank you for your suggestions and advice

Kind Regards

Helen