Working out completion with an automatic Harvey ball indicator
If you need to automate your Harvey Ball Indicator to reflect completion of tasks/questions/items ect, here is a quick example with the expression used for this example.
To work out completion you need to have the number of tasks completed which will be divided by the number of tasks overall, so first, you need to bring up all the relevant values from the child. To bring up the number of Tasks create a field [TotalTasks] with the expression childCount('ChildApp'), and another field [CompletedTasks] with the expression childCount('ChildApp','{"StatusField":"Completed"}') to bring up the number of completed tasks.
Once you have these values you can then create the completion field, this will have the expression if([TotalTasks] = 0, 0, ([CompletedTasks] / [TotalTasks]) * 100). The if statement is necessary for the situation of tasks completed being 0 to display 0 otherwise it would try and divide zero by X which would throw up an error. Because this is an expression based field you can display the formatted value as I've done below, Formatting- {0:N}%
For the Harvey ball need the expression If([Completion] < 25, '0%', If([Completion] < 50, '25%', If([Completion] < 75, '50%', If([Completion] < 90, '75%', '100%')))). To break it down each if statement is checking to see what stage completion is at, so if the completion is lower than 24.9999 it will say display the value '25%' (don't forget the single quotes as its text), if not move on to the next if statement.

Please sign in to leave a comment.
Comments
0 comments