Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I have the below sample data which has the previous year and current year sales.
Order Date | Sales |
22-08-2018 | 13.7 |
22-08-2019 | 31.5 |
04-05-2020 | 243.16 |
04-07-2020 | 25.248 |
22-07-2020 | 258.576 |
04-08-2020 | 243.16 |
22-08-2020 | 29.6 |
I use the below code to get current YTD Sales and is working and i'm getting sales of '799.744'
vCurrentYear: =Max(Year([Order Date]))
=sum({<Year={$(vCurrentYear)}>}Sales)
Now I'm looking for previous year to date expression, i tried using the below expression but it is giving output as '31.5' but it has to be '831.244 (799.744 + 31.5)'
vPreviousYear: =Max(Year([Order Date])-1)
=sum({<Year={$(vPreviousYear)}>}Sales)
Regards,
Bharath Vikas
Previous year is 2019, do you not want 2019 for previous year? You want 2020 + 2019 for previous year?
If you just want previous year then your logic is correct. Probably what you want is not previous year sales then. It's yearly cumulative sales. Where you want to show this value in chart or text object?