Hello everyone,
I would like to calculate sales KPI and show them in dashboard like Last year to date, year to date sales, calculate the year to date difference and also made it also in percentage.
First I tried with a list and used pivot table to calculate these KPIs but I encounter a case wich if an account made an order this year but not the previous year, an error : divide by 0 occurs. I can't use any operators in the formula to avoid this case.
So I tried another solution by using the "calculated metrics" plugin to calculate the difference in sales since the beginning of the year and the difference in sales since the beginning of the last year as a percentage.
This works but the display is only in the form of metric values, is it possible to build a column dashboard with the metric data as input?
Can I create an object from my metric data and use it in a dashboard ?
Or even a function that takes order.account.owner as currentUser and returns the data?
Like
Hi,
Unfortunately, it is impossible to change the display of the dashboard from the Calculated metrics add-on using basic methods.
Regarding the "Divide by zero error encountered" error, to avoid this error, you can add +0.01 /(last year to date + 0.01) to the value by which the division is performed, but this will cause a slight difference in the calculations.
You can also add filtering to the Pivot table so that records with the value "last year to date" are not included in the list, so division by 0 will not occur and you will avoid the display error.
We have created a task for our development team to investigate and develop a mechanism to address this error in future versions of the application as the error occurs at the database level.
Thank you!