Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

My SET expression now display YTD sales , How to modify so that it will display last 3 year instead of YTD ?

Hi Sir

My expression work fine :-

Sum(Aggr(SUM({<year = {'$(=Max(year))'}, month = {"<=$(=IF(GetSelectedCount(month), Max({<year = {'$(=Max(year))'}>}month), Num(Month(Today()))))"}>}sales/1000), GROUP_CLASS))

I don't know how to modify the above expression to compute last 3 year sales. Hope some one can advise me.

Paul

7 Replies
paulyeo11
Master
Master
Author

my QVF

Anil_Babu_Samineni

I don't have app access, Perhaps this?

Sum(Aggr(SUM({<year = {">=$(=AddYears(Max(year),-3))<=$(=Max(year))"}, month = {"<=$(=IF(GetSelectedCount(month), Max({<year = {">=$(=AddYears(Max(year),-3))<=$(=Max(year))"}>}month), Num(Month(Today()))))"}>}sales/1000), GROUP_CLASS))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
paulyeo11
Master
Master
Author

Hi Anil

Thank you very much. it work.

Paul

paulyeo11
Master
Master
Author

Hi Anil


I just try to change the -3 to any value for the below expression you given to me , i notice that it still display the same result :-


Sum(Aggr(SUM({<year = {">=$(=AddYears(Max(year),-3))<=$(=Max(year))"}, month = {"<=$(=IF(GetSelectedCount(month), Max({<year = {">=$(=AddYears(Max(year),-3))<=$(=Max(year))"}>}month), Num(Month(Today()))))"}>}sales/1000), GROUP_CLASS))


When i visit the label it display >=10/7/1902<=2018 which not seen right.


Paul


Anil_Babu_Samineni

Can you show that condition in text box and check?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
paulyeo11
Master
Master
Author

Hi Anil

Do you mean like this ?

condition click box.png

Anil_Babu_Samineni

Is that values are correct?

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful