Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I have created a line graph that displays a comparison between different years and flow with respect to months.
I need a date function which shows 2 months' data in this month.
For example, display the value of May 2021 when we enter July 2021.
Here I need to satisfy few conditions:
Condition 1:display all previous years and months data.
Condition2: Display all months until 2 months before this month. I mean for 2021 it should only display From Jan 2021 until April 2021.
I have already used the limitation parameter in Line chart dimension to limit the values I see.
Like if the % is less than 15% it won't display it in the chart. But I want to make a dynamic change.
For example: if the value of May 2021 is less than 15% even after the end of July I want it to display in the chart.
Happy to receive any inputs.
TIA
Regards,
Neeraja
if you make a dimension for YearPeriod in script editor , "Year" & "Period" as YearPeriod.
You can use YearPeriod in variabels. such as vLastTwoMonths. Year(today("Year")) & month(num(Period,00)) -2
or Year(today("Year")) & month(num(Period,00)) as vYTD
You can use it in the graph. In the Set Analysis write sum({<YearPeriod={$(vLastTwoMonths)}>}Amount)
or if you want to show all previous sum({<YearPeriod={">=$(vYTD)"}>}Amount)
It is always easier to work with YearPeriod.