Counting Items
In this quick post, I'll be showing you how to count up a number of items, this can be used for such things like the number of statuses, number of ticks or a number of selection options.
Below is a checklist grid field that allows people to tick their items when done, I want to total the number of ticks to see how many left I have to complete
The first step is to create a number field that will contain the expression and to display on the template. The expression I have used is:
if([Checklist_R01_Tick] = true, 1, 0) +
if([Checklist_R01_Tick] = true, 1, 0) +
if([Checklist_R01_Tick] = true, 1, 0) +
if([Checklist_R01_Tick] = true, 1, 0) +
if([Checklist_R01_Tick] = true, 1, 0) +
if([Checklist_R01_Tick] = true, 1, 0)
The above expression goes though each items tick and checks whether it is true on not, if true it then gives the value one and adds it onto the next part of the expression which checks the next row and so forth and so forth. It then should have the total number of ticks, please check to see if this is the same for you.
Please sign in to leave a comment.
Comments
0 comments