Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Expression Question

Assuming the following data:

QuoteVersionTotal
A1$500
A2$1000
A3$700
B1$1200
B2$800
C1$900

I was trying to create a Measure that would only calculate the Total from the MAX version, so in this case $700, $800 and $900 and display them in a table like this:

QuoteTotal
A$700
B$800
C$900

But my formula isn't working. I thought the formula would look something like this:

Sum({<Version=Max(Version)>} Total)

or

Sum({<Version={Max[Version]}>} Total)

The top formula doesn't give me a value. The bottom gives me $0 every time. What am I doing wrong? Do Set Expressions work in Tables?

1 Solution

Accepted Solutions
vijetas42
Specialist
Specialist

HI,

try to use expression like,aggr(FirstSortedValue(sale,-version),quote)

View solution in original post

7 Replies
Anonymous
Not applicable
Author

try to use

Sum({< Version ={$(=Max(Version))} >} Total)

sunny_talwar

May be this

FirstSortedValue(Total, -Version)

Capture.PNG

vijetas42
Specialist
Specialist

HI,

try to use expression like,aggr(FirstSortedValue(sale,-version),quote)

Not applicable
Author

vijeta, your solution worked like a charm! Thank you.

vijetas42
Specialist
Specialist

If you got your solution then please mark it as correct and close the thread.

Thanks!

Lucke_Hallbergson

Aggr function should be wrapped in an aggregation as it returns an array of values;

set_expression_question.png

sunny_talwar

You want to unnecessarily use Aggr() function (when it is not even needed here)? Did you even try this expression?

FirstSortedValue(Total, -Version)

I think you should avoid using Aggr() function unless I am missing something here.... Check my response and attached image and application above and see if it gives what you wanted

Re: Set Expression Question