Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
sreeni_qvd
Creator
Creator

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

1 Solution

Accepted Solutions
sunny_talwar

Have you tried this:

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

View solution in original post

4 Replies
PrashantSangle

Hi,

Try,

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

Kind Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
sunny_talwar

Have you tried this:

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

MK_QSL
MVP
MVP

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

Chagne InvoiceYear and InvoiceMonth to your respective field names.

sasikanth
Master
Master

try some thing like,

create YearMonth field and use that field in set expression

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