Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.

Division Operation is not working

I am not sure what happened, but it seems that the math expression, particularly the division operation, is not working at all

Screenshot 2024-02-02 150059.png

Solved Solved
0 8 169
1 ACCEPTED SOLUTION

The best option is to write it like.. (1.0 * COUNT(..)) / COUNT(..)

View solution in original post

8 REPLIES 8

Try with 1/2.0

Hey, @AleksiAlkio, it works, but I don't think it's a solution. I tried using another number, like 7400/350, etc, but the calculation is completely wrong. It's not feasible to ask users to use a comma when inputting a number.

Do you know what happened? Thank you

When you calculate with the division and both of them are numbers, the result is a number as well. If you need the result as a decimal, one of them needs to be a decimal like number/decimal or decimal/number. It doesn't mean the app user needs to add the decimal when filling the value, but your column type needs to be a decimal.

Does it mean that if my calculation formula is as follows:

COUNT(
  FILTER(
    "subtask",
      AND(
        [task]=[_THISROW].[id],
        [status]="Closed"
        )
    )
  )
/
COUNT(
  FILTER(
    "subtask",
        [task]=[_THISROW].[id]
    )
  )
I have to put a decimal formula before COUNT()?
DECIMAL(
COUNT(....
)
)

 

The best option is to write it like.. (1.0 * COUNT(..)) / COUNT(..)

It makes sense, but I am still curious because I have never experienced something like this before

Thank you @AleksiAlkio All clear now!

Top Labels in this Space