Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
KRS772
Contributor
Contributor

Create summed expression of most recent month (selected or not)

Hello,

I am trying to create a text summary that summarizes quantity from three dimensions. So total where A=x; B=x; and C=x. My issue is that one of the dimensions is Month. I tired num(sum(if(match([month_field],max(month_field),qty_field,0)),'#,##0') and this results in errors. I'v tried creating a variable of most recent month and matching month_field to that but both result in 0.

I'd like to have this static so that selections of months don't impact the text summary, but i'd settle just to formulate the expression so it works. 😉

 

Thanks,

K

Labels (3)
1 Solution

Accepted Solutions
sunny_talwar

May be try this

Num(Sum(If(Match([month_field], Max(TOTAL month_field), qty_field, 0)), '#,##0')

or this

Num(Sum({<[month_field] = {"$(=MaxString(month_field))"}>} qty_field), '#,##0')

View solution in original post

4 Replies
Anil_Babu_Samineni

Try this?
Alt(num(sum({<month_field={$(=max(month_field))} qty_field),'#,##0'), 0)
Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
KRS772
Contributor
Contributor
Author

Thank you. The syntax looks good and the expression is valid but I get the following error:

Error: Error in set modifier ad hoc element list:
',' or ')' expected

sunny_talwar

May be try this

Num(Sum(If(Match([month_field], Max(TOTAL month_field), qty_field, 0)), '#,##0')

or this

Num(Sum({<[month_field] = {"$(=MaxString(month_field))"}>} qty_field), '#,##0')
KRS772
Contributor
Contributor
Author

Thank you. The second code gave me exactly what I was looking for