Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Utility of Dollar sign expansion

Hi, I have a simple variable defined name vSample with a value of 5.

If i want to display the variable, I had always used $(vSample), but today when i tried simply =vSample in a text box it still gives me the value of 5. So what exactly is the utility of $ sign expansion. Kindly explain.

Thanks,

Nath    

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

For values like 5, you don't need to use $ sign in the expressions, but when you use 4 + 4 as definition for variable then you have to use =$(vSample), then only it will evaluate the expression otherwise it simply returns 4 + 4 as a string.

Simple, if you give $, it is LET, if you just give vSimple it works as SET.

From Help file

Set x=3+4;

Let y=3+4;

z=$(y)+1;

vSample : 4 + 4 (In Variable Overview)

$(x) will be evaluated as '3+4 '

$(y) will be evaluated as '7'

$(z) will be evaluated as '8'

vSample  = 4 + 4

$(vSample) = 8

Hope this helps you.

Regards,

Jagan.

View solution in original post

3 Replies
Anonymous
Not applicable
Author

It is best practice to use $().  It is used to calculate the variable.  So if vSample was 4+4 =vSample would yield 4+4 and =$(vSample) would yield 8.

jagan
Luminary Alumni
Luminary Alumni

Hi,

For values like 5, you don't need to use $ sign in the expressions, but when you use 4 + 4 as definition for variable then you have to use =$(vSample), then only it will evaluate the expression otherwise it simply returns 4 + 4 as a string.

Simple, if you give $, it is LET, if you just give vSimple it works as SET.

From Help file

Set x=3+4;

Let y=3+4;

z=$(y)+1;

vSample : 4 + 4 (In Variable Overview)

$(x) will be evaluated as '3+4 '

$(y) will be evaluated as '7'

$(z) will be evaluated as '8'

vSample  = 4 + 4

$(vSample) = 8

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Hi,

we can use droller expansion to form dynamic expressions also apart from evaluating expressions.

Regards,

Abhishek