0

I´ve created a Legacy Metric lens that should display the Trend (in percent CO2) compared to a baseyear of 2019. But it always defaults to display the trend compared to previous year.

I´ve created a small video here about the error.

This is my code:

(sum(co2tonnes) - sum(co2tonnes, shift='startAt(2018-12-31T23:00:00.000Z)')) / (sum(co2tonnes, shift='startAt(2018-12-31T23:00:00.000Z)'))

It calculates the difference of a sum of co2 compared to 2019 sum, and then it presents it as a percentage.

When I edit the lens and changes the global time, it works perfectly and shows the correct numbers compared to 2019: 2020 -69% 2021 -89% 2022 -98%

But when the lens is saved to the dashboard, it instead shows the numbers compared to prevoius year instead which is wrong: 2020 - 69% 2021 -64% 2022 -78%

Ive compared using the shift='1y' instead, and that works as expected. It is when I try compare with a specific year of 2019 that everything breaks.

This seems to be a bug. Anyone knows what to do?

0 Answers0