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

How to use variables in expressions

I have this expression in pivot table:

sum( {$<AcNo= {'>=3000<=3999'},VoDt= {'>20130101<20130328'}>} AcAm)

I like to use variables from_date and to_date (ihave created) instead of 20130101 and 20130328. How to do that?

//Gunnar

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Use dollar-expansion. This looks like $(vMyVariable) for a variable name vMyVariable

sum( {$<AcNo= {'>=3000<=3999'},VoDt= {'>$(from_date)<$(to_date)'}>} AcAm)


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar

Use dollar-expansion. This looks like $(vMyVariable) for a variable name vMyVariable

sum( {$<AcNo= {'>=3000<=3999'},VoDt= {'>$(from_date)<$(to_date)'}>} AcAm)


talk is cheap, supply exceeds demand
fdelacal
Specialist
Specialist

sum ( {$<AcNo= {'>=3000<=3999'},VoDt= {"$(='>='& MonthStart(date(vHOY),-2)&'<='&MonthEnd(date(vHOY),0)"}>}AcAm)

vHOY = DATE(TODAY())

Hope it helps you.

Regards.

Not applicable
Author

hi

try this

sum( {$<AcNo= {'>=3000<=3999'},VoDt= {'> $(from_date) < $( to_date )'}>} AcAm)

Not applicable
Author

What do $ sign mean in the syntax?

//Gunnar