Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to use variables in expression sets

Hi Everyone,

I'm trying to use an expression that filters my results depending on a variable. I have a variable v_Previous_Date which has the previous date found in the max value from the Date field (max(Date))

I need to make work an expression like this:

sum({$<Date=$(v_Previous_Date)>} Amount)

It doesn't work. Does anyone can help me?


1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi Jose,

Try the following instead:

Sum({< Date = {'$(=Date(v_Previous_Date))'} >} Amount)

Hope that helps.

Miguel

View solution in original post

4 Replies
Miguel_Angel_Baeyens

Hi Jose,

Try the following instead:

Sum({< Date = {'$(=Date(v_Previous_Date))'} >} Amount)

Hope that helps.

Miguel

MayilVahanan

hi,

     Try this,

          = Sum({<Date = {'=$(=v_Previous_Date)'}>}Amount)

    

     Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Anonymous
Not applicable
Author

It works, thanks everyone!

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You'll need braces around the value.

sum({$<Date={$(v_Previous_Date)}>} Amount)

Since you stored max(Date) in a variable, it's a string so probably in mm/dd/yyyy format. You may need single quotes around the value as well.

sum({$<Date={'$(v_Previous_Date)'}>} Amount)

-Rob