Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using dollar expansion & Variable in Expression

Hi! I'm having a block on creating an expression to automatically get data from the most recent quarter in a table. I know it's simple, but ... Doh!

I am using a Load statement to get a single value for the end date of most recent quarter with data.

I'm putting that in a variable varMostRecentQtr. That has the value I want (today it's - 30/06/14)

I now want to aggregate Sales Value for that qtr so I'm using

=sum({$ <EndofPeriod={$(varMostRecentQtr)}>} SalesValue)

To get the sum of the current selection with a dollar expansion of the variable. I'm clearly doing something wrong as it's not working....

Bob

1 Solution

Accepted Solutions
Not applicable
Author

Thanks, both - I knew it would be something simple!! I *hate* the intricacies of the set editor - there should be a wizard!

View solution in original post

3 Replies
tresesco
MVP
MVP

Try putting single quotes around variable expansion like:

=sum({$ <EndofPeriod={'$(varMostRecentQtr)'}>} SalesValue)

PrashantSangle

Hi,

Try this,

=sum({$ <EndofPeriod={"$(=varMostRecentQtr)"}>} SalesValue)

or

=sum({<EndofPeriod={"$(=varMostRecentQtr)"}>} SalesValue)

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Thanks, both - I knew it would be something simple!! I *hate* the intricacies of the set editor - there should be a wizard!