Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I have a total for the year 2021 and I'm working on an expression for future years until 2030 by subtracting from the previous year something like;
if 2021 has a total of 1000
then 2022 has a total of 1000-100=900
2023 has a total of 800
2024 has a total of 700
Can anyone help me ? I’m struggling to find the correct solution for a few days.
Thanks in advance for your help.
can you post some sample data? also confirm if you are trying to achieve this at a chart level or script
It is a chart. I used the expression below;
if (Year = 2021, sum ({$<fType ={'DDG'}>}fAmount),
if (Year > 2021, sum({$<Year> - 1}fAmount) - 100))
Basically, I just want to come up with an expression that gives me a subtraction of 100 from the previous year total.
Try below
Current Year = sum ({<fType ={'DDG'}, Year={"$(=Max(Year))"}>}fAmount)
Previous Year = sum ({<fType ={'DDG'}, Year={"$(=Max(Year)-1)"}>}fAmount)
Previous Year - 100 = sum ({<fType ={'DDG'}, Year={"$(=Max(Year)-1)"}>}fAmount) - 100