3

I have a tracking list consisting of the following:

enter image description here

The red boxes represent different persons (always the same). To track the status of the approval, I would like to add a new column and thought it may be possible as per calculated column, that displays a step counter based on the content of the specific red field.

The content is either "Pending", "Approved" or "Not required".

So, for example, a project requires 10 out of 20 possible persons to approve the idea, Status of 10 Persons (as represented by red bars in the picture) would be "pending". I would like the step counter to ask how many fields are stated as "Pending+approved" and take this amount (=X) and also ask for an amount of fields with content "Approved" only (=Y) and display this as simple as X/Y.

The result would be 5/10 for example if 10 persons were required (=pending or already approved) and 5 out of those already have the status "Approved". So first number has to be the amount of column contents "Pending+Approved" as a number and the second number the amount of column contents "Approved" as a number.

Can I achieve this functionality with a calculated column or is there another way?

Thank you for your help!

1 Answer 1

2

Calculated Columns are for specific list items only (think of them as per row) so you won't be able to perform calculations across multiple list items.

This is a good use case for Client Side Rendering (JSLink) since you are in SP 2013.

I've written a primer for getting started with CSR for listviews in SP2013 on my blog here: https://thechriskent.com/2016/04/11/csr1-an-introduction-to-client-side-rendering/

For what you are trying to do, you can access the full set of returned rows within the Header template and should be able to use some basic logic to get your counts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.