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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set a field as a variable??

In my current model im trying to set a variable to read data from a column in an excel sheet. Im trying to set the field name as the variable so that if the data changes, it wont affect the variable being read by a where condition. It saves me having to hard code data.

i tried "let vCost=COST(which is the field name) but it doesnt seem to work in practice.

any advice?

2 Replies
MayilVahanan

Hi,

     Try this,

     Set vCost = Cost;

    

The Set command assigns the variable the text to the right of the equal sign, whereas the Let command evaluates the expression. 

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Hi,

The field "COST" contains a thousand rows of data. So I would like to create a variable to account for all the data. If that makes sense.