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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

Complete commands - variable - from a file?


`Hi,

I am just trying to implement the following in all of my apps:

=> The target values (like e.g. 96% presence quota) should be stored in one central xls file instead of being hard-coded in the apps.

=> To avoid the additional effort for anyone creating a new display in QlikView, I can generate the complete SET_command in Excel,

     with the ',' replaced by a '.' and such.

=> Can I somehow make QlikView execute those commands once they have been loaded?

Thanks a lot!

Best regards,

DataNibbler

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Here's an example of code that loads an excel file and create variables from that data: Re: How does this code work?Creating variables using loop


talk is cheap, supply exceeds demand
datanibbler
Champion
Champion
Author

Hi Gysbert,

this is very helpful. Thank you!

(there might be a dozen or so target_values in one app, so I'd have to create a dozen variables ...)

Only one question: There is a reference to a field vVarFormula or so in the code - how does that have to look in the Excel file?

Could you perhaps create a small sample file (one or two lines) which this code could be based on?

Thanks a lot!

Best regards,

DataNibbler

P.S.: It might be better, if you could do that, to do it in the other thread so that anyone else looking for that can find it easily.

datanibbler
Champion
Champion
Author

Hi Gysbert,

don't bother. I made it now. Took me a while, but I think that's worthwhile.

The field 'varValue' must only contain the actual value - well, then again, it might be worthwhile writing that hint in the other thread ...

Best regards,

DataNibbler

datanibbler
Champion
Champion
Author

Hi Gysbert,

something still seems to be wrong.

I have the code working now - it creates all the variables I need based on the Excel file - all but two ..

I have already edited the fields in the Excel file to eliminate blanks, but for two lines - the second and third record which are loaded (so i should have the values 1 and 2), no variable is generated and I cannot explain why?

Can you help me there?

Thanks a lot!

Best regards,

DataNibbler

P.S.: OK, forget it 😉 I tricked myself - after I had taken out the blanks from the Excel file, I changed the name (in the Excel file), copied it to QlikView - and forgot to use the AS option to eliminate the blanks 😉

Now it works.