Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
debabrata_sahoo
Contributor III
Contributor III

How to write set analysis of current year sales for product which sold last year

Hi everyone,

Please help me to write set analysis of current year sales for product which sold last year .

Source:-

Product       Year         Sales
A                   2017            100
B                   2017           200
C                   2017            300
A                   2018            400
B                   2018            500
D                   2018            600

 

Output:- 

Product            sum of Sales
A                                  400
B                                  500

 

Thanks

 

2 Solutions

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

maybe this:
=sum( {< Year = {"$(=Max(Year))"}, Product = {"=Sum( {1< Year = {[$(=Max(Year)-1)]} >} Sales )>0"} >} Sales )
I hope it helps.

View solution in original post

albert_guito
Creator II
Creator II

Hi,

Try with this expression:

SUM({<Year={2018},Product=P({1<Year={$(=Max(Year)-1)}>})>} Sales)

You can custom the current year with a calculated vale also


Ag+

Ag+

View solution in original post

3 Replies
agigliotti
Partner - Champion
Partner - Champion

maybe this:
=sum( {< Year = {"$(=Max(Year))"}, Product = {"=Sum( {1< Year = {[$(=Max(Year)-1)]} >} Sales )>0"} >} Sales )
I hope it helps.
albert_guito
Creator II
Creator II

Hi,

Try with this expression:

SUM({<Year={2018},Product=P({1<Year={$(=Max(Year)-1)}>})>} Sales)

You can custom the current year with a calculated vale also


Ag+

Ag+
debabrata_sahoo
Contributor III
Contributor III
Author

Its working. Thanks...