Expand my Community achievements bar.

Latest Community Ideas Review is Out: Discover What’s New and What to Expect!
SOLVED

Sum of all numeric values present in a custom form field using collection

Avatar

Level 1

Hi All,

 

I have a similar situation where I need to check a numeric field of a Custom form which is created at issue level. 

 

 

valueexpression=IF({DE: Audit Type}="Design" && {DE: Audit Phase}="Post-go-live audit", {DE: PROD Audit Error Count})
listmethod=nested(issues).lists
valueformat=HTML
displayname=Total PROD Errors 
textmode=true
type=iterate

 

Here I'm getting the output something like this; 4,6,8

However, I would like to sum all the values i.e., 4+6+8 = 18. 

 

Would appreciate any help on this matter.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

As you've discovered you won't be able to do calculations on collections within a reporting column.

 

Your best option is going to be to create a calculated field on your custom form to capture that data and then pull it into the report. 




View solution in original post

3 Replies

Avatar

Level 1

Just for the records, I've thoroughly reviewed all available documentation and haven't found a solution to this issue yet. While working with collections in WORKFRONT, it seems we don't have an option to sum all iterated values directly. However, considering that a collection is essentially an array without any index, it should theoretically be possible to sum all its values.

 

For instance, if I obtain the output as 4, 6, 8 using the code I've shared, I'm considering adding another column. From there, I could potentially utilize the values (4, 6, from this column, remove the delimiters, create a array, and then sum all the values in the array.

  • Would this approach be feasible? 
  • Can we use array functions in text mode?

I have recently started working on Workfront so apologies if this sounds a naive question.

Avatar

Correct answer by
Community Advisor

As you've discovered you won't be able to do calculations on collections within a reporting column.

 

Your best option is going to be to create a calculated field on your custom form to capture that data and then pull it into the report. 




Avatar

Level 1

Thank you @kellie! I also thought about that but it is not feasible in my case given.