Comparing a dataset field against a calculated field

Hi I have a dataset field called TOTAL_POR_DEV (numeric field) and I have created a calculated field called RENTA with the following code:

RENTA_POR_DEV + RENTA_IVA_POR_DEV (both are datset numeric fields)

So far so good, now I want to create another calculated field that compares TOTAL_POR_DEV and RENTA, if they are equal put ‘equal’ and if not put ‘not equal’

I have tried the following

ifelse(TOTAL_POR_DEV = RENTA, “equal”, “not equal”)

and

ifelse(round(TOTAL_POR_DEV,0) = round(RENTA,0), “equal”, “not equal”)

This 2 tries sends every output to not equal even when they are equal…

I have tried also
ifelse(sum(TOTAL_POR_DEV) = sum(RENTA), “equal”, “not equal”) and with the respective rounds

when I click on save it does not shows an error but in the table sends an sql error

For this first two calculated fields are you sure that there aren’t any more groupings that you are missing?

For the third it’s a calculated field error? Can you show that error?

I tried a simple case, which works, so I would expect this could be a precision issue.
Can you try something like ifelse(abs(TOTAL_POR_DEV - RENTA) < 0.01, “equal”, “not equal”) ?

1 Like

Thank you both, I guess something was messing up with the data in the dataset, waited a few minutes and it worked.

2 Likes

Glad it worked @Enrique_Martin! Thanks @Max and @chengguo! :slight_smile:

1 Like

I’ll mark this as solved as there are no outstanding issues to be answered.
Thanks @Max and @chengguo