Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Im thinking of making a document libary with files that have a field "type_of_document" which gives the type of document e.g. "meeting notes". I wont make hem content types, just a column where multiple 'types' can be added for 1 file (in case the file contains multiple documents in one). Each of the documents is tied to a `collection´ number. The ´collection´ number is tied to multiple documents. I dont use document sets.

I now want to make a view where the content is categorized - ordered by that number.

Until so far that it is simple. But now: a certain amount of those 'type_of_document' will be required per 'collection number'. So now I want to place a percentage next to the 'collection number' based on the amount of 'type of document' entries matching the required list (this will probably be a workflow).

Would that be the best approach?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Create a DVWP, not a list view. You can edit the XSL to calculate the percentage. Here is an example from the Technet Forums

First, we should calculate the sum of the “count” column in the list. the formula is “ sum(/dsQueryResponse/Rows/Row/@Count) ”; Second, we should calculate the sum of the “count” column in every group. The formula is “ sum(/dsQueryResponse/Rows/Row[@Category=$thisNode/@Category]/@Count) ” Now, we can get the Percent of every group using “ format-number(sum(/dsQueryResponse/Rows/Row[@Category=$thisNode/@Category]/@Count) div sum( /dsQueryResponse/Rows/Row/@Count),'##.#% ')”

Replace @Category with @Type_of_document (i.e. the name of your column.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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