# QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

New Contributor III

## 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

Tags (1)
1 Solution

Accepted Solutions
MVP

## Re: Year wise Last month Sales

Have you tried this:

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

4 Replies

## Re: Year wise Last month Sales

Hi,

Try,

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

Kind Regards

Regards,
Prashant Sangle
MVP

## Re: Year wise Last month Sales

Have you tried this:

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

MVP

## 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.

Valued Contributor III

## 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)