Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
zagzebski
Creator
Creator

Calculated Dimension of last year with sales

I need to create a calculated dimension where the last Year Month of sales is a calculated dimension  - by Customer. Like below.

DATA:
CustomerSale Year MonthAmount
A201501100
A201502200
A201504300
A201506400
A201507500
A2015080
B20140850
B201410100
B2014120
B201501

100

RESULT of LAST MONTH WITH SALES:
CustomerSale Year MonthAmount
A201507500
B201501100

Thanks in advance,

Zag

4 Replies
sunny_talwar

Try this:

Dimension: Customer

Expressions:

1) FirstSortedValue([Sale Year Month], -[Sale Year Month])

2) FirstSortedValue(Amount, -[Sale Year Month])


1) FirstSortedValue({<Amount = {'<>0'}>} [Sale Year Month], -[Sale Year Month])

2) FirstSortedValue({<Amount = {'<>0'}>} Amount, -[Sale Year Month])


Capture.PNG

zagzebski
Creator
Creator
Author


Thanks Sunny for the feedback - unfortunately that didn't work. Got nothing to come back.

sunny_talwar

Made some modifications above. Please check again.

Best,

Sunny

zagzebski
Creator
Creator
Author

thanks for the feedback - wasn't able to get it to work for my issue - but I did use this function in another area. Thanks!