Calculated fiel

Hi, I am trying to do the subtraction of two calculated fields, I have tried doing the normal subtraction, but it gives me an error, so I have used an agg to do it. I don’t get an error in the calculation, but when I add the field to a visual KPI it says this:

The calculation is as follows :

Can you try using a PRE_AGG calculation?


For more information:

Hello @Max ,

It does not work because the target field is already a calculated field.

I need to subtract two calculated fields, but I don’t know the way, I have tried with pre agg as well.

HI @Raulsc

can you try sumover after finding the difference of the metrics . Since both measure at the same level it should work.

sumOver({Objectivo.}-{Ventas Act New},[{CODIGO_OBJECTIVO}])


Hi @apjvinod ,

those two fields are already calculated, and I think the error is because of that. It should not be difficult to do the subtraction of two fields, but I can’t get it, thanks for your help.

HI @Raulsc

PRE_AGG should work in this case to include it in the KPI visual .

sum(sumover({Objectivo.},[{CODIGO_OBJECTIVO}],PRE_AGG)-sumover({Ventas Act New},[{CODIGO_OBJECTIVO}],PRE_AGG))

If this is didn’t work , please give us more context on usecase and along with screenshot of each LAC calculated field expressions.