Announcements
You can succeed best and quickest by helping others to succeed. Join the conversation.
cancel
Showing results for
Did you mean:
Contributor III

## Set analysis in straight table

Good day!

I need to calculate Sum(Sales) by quarters, excluding sales in last month each quarter.

Data:

The "to be" table should looks like this:

The table "as is" now look like this:

I can estimate MaxMonth in each row, but for Sum(Sales) expression it doesn't fit.

Expr. for maxMonth:

Max(Month_numberReport)

Expr. for Sales(no last month):

Sum({<Month_numberReport=e({<Month_numberReport={\$(=Max(Month_numberReport))}>}Month_numberReport)>}Sales)

Is there any ideas?

Thank you.

1 Solution

Accepted Solutions
MVP

Try this

=Sum(Aggr(If(DateReport <> Max(TOTAL <QuarterReport>DateReport), Sum(Sales)), QuarterReport, DateReport))

2 Replies
MVP

Try this

=Sum(Aggr(If(DateReport <> Max(TOTAL <QuarterReport>DateReport), Sum(Sales)), QuarterReport, DateReport))

Contributor III
Author

Thanks, Sunny! It works

Community Browser