For some reason the completion rate is return 0. I have two tables: projects and project_tasks. I'm getting back the correct # of tasks by status, but when I do [_THISROW].[Completed Tasks]/[_THISROW].[Total Tasks] it returns 0.
Here are the raw #'s
Here are my field definitions
Total Task
Total Tasks = COUNT(FILTER("project_tasks", [project_id] = [_THISROW].[id]))
Open Tasks = COUNT(FILTER("project_tasks", AND([Status] <> "Done", [project_id] = [_THISROW].[id])))
Completed Tasks = COUNT(FILTER("project_tasks", AND([Status] = "Done", [project_id] = [_THISROW].[id])))
Completion Rate = [_THISROW].[Completed Tasks]/[_THISROW].[Total Tasks]
When I test the expressions, the Total Tasks, Open Tasks and Completed Tasks are correct
I switched the type between decimal and percentage. Still nothing.
What am I missing??
Solved! Go to Solution.
Because the Task columns are defined as NUMBER, the resulting expression is attempting to return a like NUMBER value as well. The decimal result is less than 0.5 so the NUMBER result rounds DOWN to zero.
Try this expression instead:
([_THISROW].[Completed Tasks] * 1.0) / ([_THISROW].[Total Tasks] * 1.0)
You probably don't need to multiply both operands. I do ... just because!
User | Count |
---|---|
15 | |
15 | |
8 | |
7 | |
4 |