Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

Problem with the format of a variable

Hi,

I actually have a problem with a rather complex formula that I'm trying to develop to encompass either of two different scenarios.

As a step toward fixing that problem, I am trying to make it a bit less complex by employing a variable to make the code of that formula shorter and easier to handle.

=> That leads me to the following problem:

- The variable I want is a date in german format (DD.MM.YYYY) - that format is in one of the SET commands on the MAIN tab
   of the script.

<=> For some reason I cannot use that $() thingy - when I test it in a textbox on the GUI, it works without that - but when I add that, it doesn't work. In the script, however, I have to somehow tell QlikView that this is a variable and not a field.

Can someone help me out of this dilemma?

Thanks a lot!

Best regards,

DataNibbler

1 Solution

Accepted Solutions
qliksus
Specialist II
Specialist II

Hi,

Please go to the help and read about SET and LET which will clear your question

Since you have used LET in the script, it exceute and store the output which is a value.

$(variable) used to execute of the expression written inside the variable throws blank due unavailability of expression.


View solution in original post

4 Replies
qliksus
Specialist II
Specialist II

Hi,

can i know how you have written the expression for varibale and textbox?

datanibbler
Champion
Champion
Author

Hi,

of course you can - sorry, I was away eating.

In the script I have written

>>> LET v_left4good = PEEK('left_for_good'); <<<

(where "left_for_good" is the name of a field I have just loaded - there is just 1 record generated by that LOAD_statement)

In the textbox on the GUI I have just written

>>> = v_left4good <<< or >>> = $(v_left4good) <<<

(the former version works, the second does not display)

<=> Now I don't quite know how to let QlikView_script know that this is not a field to look for, but a variable.

Thanks a lot!

Best regards,

DataNibbler

P.S.: I guess I can do it a different way - by loading that date twice in the original base_load (that precedes the code that is lateron going to be a subroutine) - once in date_format and once in numeric format for the comparison. I have looked up a bit of code in a different app where I do just this - only with a plain number, not with a date. Then I can well use that $() and I can tell QlikView in the script that this is a variable.

<=> Still, I'd like to know why this doesn't work with a date in that format (DD.MM.YYYY)

qliksus
Specialist II
Specialist II

Hi,

Please go to the help and read about SET and LET which will clear your question

Since you have used LET in the script, it exceute and store the output which is a value.

$(variable) used to execute of the expression written inside the variable throws blank due unavailability of expression.


datanibbler
Champion
Champion
Author

Thanks qliksus,

I expected to stumble over this distinction eventually...

Thank you very much for explaining!

Best regards,

DataNibbler