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

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

Hi create variables

Hi everyone

I would like to use sub routine to create a set of variables, which using the user provided field name as part of the variable so it is easy to distinguish, for example, it is something like:

sub create_variables('field');

let vABC_ & $(vfield) = ....

...

Is it possible to do so? Thanks for your help in advance!

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

This should work:


let vABC_$(vfield) = ....

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

5 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

I don't understand what you're trying to do. Can you explain in more detail with an example?


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks for your help first.

I would like to create a variable based on the field provided by user. For example, I have a field which name is"qty" in table 1. I pass this value by using sub. Then, the function inside the sub will create a variable by using the field name as a suffix (e.g.  vABC_qty ). is it clear now?

jonathandienst
Partner - Champion III
Partner - Champion III

This should work:


let vABC_$(vfield) = ....

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Users don't interact with the load script. So this isn't possible in the script.


talk is cheap, supply exceeds demand
Not applicable
Author

Yes! It works! Thank you so much!