Show year back data at the same time when choosing current year

Hi there,

I have a parameter ‘year’ which has the year from 2020 to 2024.
image

Q1:
I want to create two visuals to show the sales of 2022 and sales of 2023 when choosing year as 2023. Is it possible to do so?
image

Q2:
Can I get the average sales between 2020-2023 when choosing year as 2024?

Thank!

Hi,

You can do this easily by using the period function.
Check the documentation for period functions.

Regards,
Naveed Ali

Hi Naveed,

I am trying this:
periodToDateAvg({campaign_aum},{year_start},YEAR)

It seems not generating the result as what I thought. What I am trying to do is like:

Say
2020: 10
2021: 15
2022: 20
2023: 25
2024: 30;

When choosing year as ‘2024’, it gives me the average of (15+20+25)/3 = 20;
When choosing year as ‘2023’, it is (10+15+20)/3 = 15;