Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
Qlik Connect 2025! Where innovative solutions turn your data visions into reality: REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
sunil-kumar5
Creator II
Creator II

Previous Month and previous year product sales

Hi All,

I was able to create KPI for current month and current year product sales based on ID. Now I am looking for last month sales and last year sale. This is will not required some the expression will be start with count(distinct..

Product IDInstallation Date
681701-02-2017
493901-02-2018
542301-02-2019
230301-02-2020
322601-02-2017
306401-02-2018
354708-07-2020
786208-07-2020
603001-02-2017
781001-02-2018
580001-02-2019
439008-07-2020
780801-02-2017
583501-02-2018
629301-02-2019
701908-15-2020
798708-02-2020

 

Please advise as its urgently needed.

Thanks

Sunil Kumar

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Check it here : https://community.qlik.com/t5/New-to-Qlik-Sense/Current-Month-and-Previous-Month-Product-Count-on-KP...

Count(Distinct {<Year={'$(=Year(Today()))'}, Month={'$(=Month(Today()))'}>} [Product ID] )

View solution in original post

2 Replies
tresesco
MVP
MVP

Check it here : https://community.qlik.com/t5/New-to-Qlik-Sense/Current-Month-and-Previous-Month-Product-Count-on-KP...

Count(Distinct {<Year={'$(=Year(Today()))'}, Month={'$(=Month(Today()))'}>} [Product ID] )

sunil-kumar5
Creator II
Creator II
Author

Superb!! Thanks Tresesco for the solutions. I have MTD ,YTD , Previous Month and Last year on the basis of expression your provided.

Will you please help me to calculate the quarter sales as well, not able to get it correct. Like current quarter vs previous quarter?