Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
antonaks
Creator II
Creator II

expression with '$(=)' in script

Hello everybody.

I encountered such a problem.

In the loading script, I set the variable:

SET vTEST = sum({<DateKey = {'$(=max(DateKey))'}>} SUM_IN_WITH_NDSmov);

But in after reload variable looks like this:

sum({<DateKey = {''}>} SUM_IN_WITH_NDSmov)

I asking for help.

With best regards,

Anton.

1 Solution
7 Replies
swuehl
MVP
MVP

I usually store these kind of variables in an Excel file using something like

http://www.qlikfix.com/2011/09/21/storing-variables-outside-of-qlikview/

which does also fix the dollar sign expansion issue.

antonaks
Creator II
Creator II
Author

Thank you.

I already solved my problem with "excel solution". But now I'm wondering how to correctly declare a variable in the load script.

sunny_talwar

The two links that I have shared have 2 different techniques listed in them... have you looked at them?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Keep in mind that as long as you do not literally quote the string with dollars in your script, the $() won't get expanded.

You can pass around using variables and/or fields in statements any string with $()'s that should not be expanded. $-expansion will not happen on variable or field content, only on statement syntax inside your script and by the script engine (more precisely by a sort of pre-processor inside the parser) and before the statement is evaluated.

Functions also don't bother with $-sign expansion.

antonaks
Creator II
Creator II
Author

Thank you.

I'm studying your material now.

antonaks
Creator II
Creator II
Author

I solved problem with.


SET _varName = vTEST;

SET _varValue = sum({<DateKey = {'@(=max(DateKey))'}>} SUM_IN_WITH_NDSmov);

LET  [$(_varName)] = Replace('$(_varValue)','@','$');


Thank you!