
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Accepted Solutions
.png)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jose,
Try the following instead:
Sum({< Date = {'$(=Date(v_Previous_Date))'} >} Amount)
Hope that helps.
Miguel
.png)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jose,
Try the following instead:
Sum({< Date = {'$(=Date(v_Previous_Date))'} >} Amount)
Hope that helps.
Miguel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
Try this,
= Sum({<Date = {'=$(=v_Previous_Date)'}>}Amount)
Hope it helps
Please close the thread by marking correct answer & give likes if you like the post.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It works, thanks everyone!


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
