4 Replies Latest reply: Apr 27, 2016 9:01 AM by sasi k

# Year wise Last month Sales

Hi All,

I wrote this expression, If select any year, I am getting  complete month wise sales (Possible months).

Sum({\$<Year = P({1<Year={\$(=Only(Year))},MonthNo ={\$(=max(MonthNo))}>})>}Sales)

But I am expecting. If I select any Year, In that year what is the last month Sales only.

Regards:

Sreeni

• ###### Re: Year wise Last month Sales

Hi,

Try,

Sum({<MonthNo={"\$(=max(MonthNo))"}>}Sales)

Kind Regards

• ###### Re: Year wise Last month Sales

Have you tried this:

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

• ###### Re: Year wise Last month Sales

=SUM({<InvoiceYear = {'\$(=Max(InvoiceYear))'}, InvoiceMonth = {"\$(=Month(MakeDate(Max(InvoiceYear),Max({<InvoiceYear = {'\$(=Max(InvoiceYear))'}>}InvoiceMonth))))"}>}Sales)

Chagne InvoiceYear and InvoiceMonth to your respective field names.

• ###### Re: Year wise Last month Sales

try some thing like,

create YearMonth field and use that field in set expression

sum({<YearMonth={\$(=max(YearMonth))}>} Sales)