Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello! I would like help with a code about MoM %, percentage of growth compared to the previous month. In this case, my code is this one, but it didn't bring me any result. I believe the problem is in the date code itself. Thank you in advance.
Sum({<ds_estrutura = {"Ativos"}, ds_tipo = {"QUADRO_INDICADOR"},dt_calendario = {"$(=Date(dt_calendario))"}>} vl_indicador)
/
Sum({<ds_estrutura = {"Ativos"}, ds_tipo = {"QUADRO_INDICADOR"},dt_calendario = {"$(=Date(AddMonths(dt_calendario, -1)))"}>} vl_indicador) - 1
Hi, you can try adding a table with each division operator in his own expression, one for the numerator and another for the denominator. And check if only one of them is failing to calculate.
Maybe some month selection is causing the divisor to fail and have to ignore selections so the calculated date is reachable, something like:
Sum({<ds_estrutura = {"Ativos"}, ds_tipo = {"QUADRO_INDICADOR"},dt_calendario = {"$(=Date(AddMonths(dt_calendario, -1)))"},dt_año,dt_mes,dt_trimestre>} vl_indicador) - 1