Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8170975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:18:40+00:00 2026-06-06T21:18:40+00:00

I am in the process of building a dashboard where I am using DVWP’s

  • 0

I am in the process of building a “dashboard” where I am using DVWP’s and XSLT to show the client things such as total count of tasks, how many open, how many closed etc. similar to this article

My issue is that I have a multi-value lookup column for which I need to get the count of the values, but I am not able to generate any results with what I have tried.

Any suggestions or recommendations on how to accomplish would be great.

So to add to the above as an update:

I am not exactly certain the best approach on how to achieve the desired results. Essentially I have a multi-value lookup column that currently has 20 values. The client has the ability to add new values when needed. So what I am attempting to do is to get a totals type count of the values they have selected for each record.

So let’s say for example the lookup colum has five (5) values:

Value 1
Value 2
Value 3
Value 4
Value 5

In the newform.aspx they have the ability to select multiple values (so the could select value 3 and value 5; or value 2, value 4, and value 5 etc etc). In the list view it of course shows the selections as it should. What I am attempting to do is to get a total count of those values.

For example the output would look something like:

Value 1 : 5
Value 2 : 1
Value 3 : 2
Value 4 : 3
Value 5 : 6
Value 3 & 5 : 4

Value 2,4, & 5: 3

I am not certain about the XSLT to develop such a thing as I have not had to do this with such a complex Lookup Column before. Normally I would do someting like below, but this only gets me the basics, and since the values can be combined I am not certain how to approach:

<xsl:template name="dvt_1.body">
    <xsl:param name="Rows"/>
    <xsl:variable name="total1" select="count(/dsQueryResponse/Rows/Row/@MyLookupCol.[contains(.,'1;#Value1')])"></xsl:variable>
                    <xsl:call-template name="cs3_totalRow">
                        <xsl:with-param name="cs3_RowName1">
                            Value 1
                        </xsl:with-param>
                        <xsl:with-param name="cs3_RowValue1">
                            <xsl:value-of select="$total1"/>
                        </xsl:with-param>
                    </xsl:call-template>
            </xsl:template>

            <xsl:template name="totalsRow">
                <xsl:param name="RowName1"></xsl:param>
                <xsl:param name="RowValue1"></xsl:param>
                    <table>
                        <tr>
                            <td>
                                <xsl:value-of select="$cs3_RowName1"/>:
                            </td>
                            <td>
                                <xsl:value-of select="$cs3_RowValue1"/>
                            </td>
                        </tr>
                    </table>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T21:18:41+00:00Added an answer on June 6, 2026 at 9:18 pm

    OK; figured it out. You will need to use MUENCHIAN METHOD which utilizes keys in order to generate something of a “distinct group by” list and then use count in your expression and count the keys.

    References used are here and here

    See the code below for details:

    <!--GROUPING USING THE MUENCHIAN METHOD-->
    <!--Add a key as shown below. This is important! Will not "group by" without it-->
    <xsl:key name="YourKeyNameHere" match="Row" use="@YourColumnName"/>
    
       <xsl:template match="/">
          <!--Get your column values look you normally would-->
          <xsl:variable name="cbs_Rows" select="/dsQueryResponse/Rows/Row/@YourColumnName"/>
          <table border="0" width="100%" cellpadding="2" cellspacing="0">
             <tr valign="top">
                <th class="ms-vh" nowrap="nowrap">TheValueName</th>
                <th class="ms-vh" nowrap="nowrap">ValueTotals</th>
             </tr>
             <!--This gets the distinct strings for you.-->
             <xsl:for-each select="//Row[generate-id() = generate-id(key('YourKeyName', @YourColumnName)[1])]">
                <xsl:sort select="@YourColumnName"/>
                <xsl:for-each select="key('YourKeyName', @YourColumnName)">
                    <xsl:call-template name="Rows.RowView" />
                </xsl:for-each>
             </xsl:for-each>
          </table>         
       </xsl:template>
       <!--then build your row view-->
       <xsl:template name="Rows.RowView">
          <xsl:variable name="SortValue" select="ddwrt:NameChanged(string(@YourColumnName), 0)"/>
          <xsl:if test="string-length($SortValue) &gt; 0">
             <tr id="group0{generate-id()}">
                <td>
                   <xsl:value-of select="@YourColumnName"/>
                </td>
                <td>
                    <xsl:value-of select="count(key('YourKeyName', @YourColumnName))"></xsl:value-of>
                </td>
             </tr>
          </xsl:if>
       </xsl:template>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I once saw the GLMM modeling building process using the following script: dative.glmm8 <-
We are in the process of building a web application for a client and
I'm in process of building an app for Facebook using Python and Django. I'm
I am in the process of building a RESTful web service using ASP.NET Web
I'm in the process of building an web app that will, besides other things,
I'm in the process of building a web application using cherrypy. What template technology
I am in a process of building an intranet application entirely using silverlight 3.
In the building process of an array I'm trying to call a function, checkIfNodeExists()
During the process of building software applications, you would start testing what you have
In the process of building a third party bundle for the Symfony2 framework I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.