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: 
paul_hallwood
Contributor II
Contributor II

Setting a Variable Definition In Script

I'm trying to create a variable within script that will then display this variable in a text box.  Currently in the script I have:

SET varData_Status_Year='=[Year] & '/' & ([Year] + 1)';

(where [Year] is the year selected by the user)


The output I am trying to get is e.g. 2013/2014

But when I reload the information and look at the textbox, all I get displayed is the text =[Year] & '/' & ([Year]+1) despite assigning the variable varData_Status_Year to the textbox.  It's as if the definition of the variable hasn't been evaluated.


Any ideas warmly welcome.  Can I even concatenate existing fields with text to create a variable???

10 Replies
paul_hallwood
Contributor II
Contributor II
Author

Hi Michael,

Upon looking at your answer I realised where I had gone wrong.  I thought I had tried your suggestion of the dollar sign before the brackets, but I think that I was using a different variable at the time.  I was using a variable varData_Status_YEAR as opposed to varData_Status_Year.

Just shows you the importance of writing the variable exactly as it is defined.  Doh!

Apologies for this guys.  Query answered!