SharePoint User Group UK

Share the knowledge!

Welcome to SharePoint User Group UK Sign in | Join | Help
in
Home Blogs Forums Photos Files Roller

Custom List Grouping and Total

Last post 07-02-2009, 8:53 AM by Paul Leigh. 1 replies.
Sort Posts: Previous Next
  •  07-01-2009, 10:49 PM 19648

    Custom List Grouping and Total

    Hello All, I need some help!
    I have a Custom List which have four fields
    Country [Type Single Line Text]
    Male [Type Number]
    Female [Type Number]
    Group [Type Single Line Text]

    item 1
    Country: UK
    Male : 5
    Female: 0
    Group: A

    Item 2
    Country: US
    Male: 4
    Female: 2
    Group: A

    Item 2
    Country: UK
    Male: 2
    Female: 1
    Group: B

    When I group them in to country it shows the number of the items/countries in the group but how can i get the total number of unique countries in the list? Thank you!S
  •  07-02-2009, 8:53 AM 19652 in reply to 19648

    Re: Custom List Grouping and Total

    Hi,

    There isn't a way to do this OOTB but you can achieve the same with some JavaScript.

    Add a Content Editor Web Part below the List View Web Part on the page including your custom grouped view. Then add a javascript code block and search for the number of instances of the TD element with the style of "ms-gb". Do a count of these and that is the number of distinct grouped items. Output the result however you choose via the javascript.


    Paul Leigh
    ---------------------------------------------
    Software Architect and a QuikR Microlight pilot in my spare time.
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems