Microsoft Developer Network > 포럼 홈 > SharePoint - Design and Customization > Averaging particular items to get an overall status
질문하기질문하기
 

제안된 답변Averaging particular items to get an overall status

  • 2009년 6월 29일 월요일 오후 7:51Mikey52 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    I'm having trouble articulating this so hopefully I make sense!  I have a list which contains project names, their associated manager, and the status.  What I am trying to do is have a listing of each manager and an overall status of their projects.  I want to take all of the projects, average the status field, and output this to a list or somehow display each manager and a single overall status field.  I'm drawing a blank on this, not even sure if it's possible.

모든 응답

  • 2009년 6월 30일 화요일 오전 6:14Mike Walsh MVPMVP, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    Moving to Admin. Not site customization.
    WSS FAQ sites: http://wssv2faq.mindsharp.com and http://wssv3faq.mindsharp.com
    Total list of WSS 3.0 / MOSS 2007 Books (including foreign language) http://wssv3faq.mindsharp.com/Lists/v3%20WSS%20FAQ/V%20Books.aspx
  • 2009년 7월 2일 목요일 오후 5:31Mchova01 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     코드 있음

    Hello Mikey52,

     

    I ran into a similar situation recently.  We tied several combinations of creating an algorithm to support this, but ultimately decided on a bar chart to display the number of projects in each category (i.e. Red, Yellow, Green) and scaled the width of the table cell to be the percentage of the total.  The reason we went with this approach was due to how the value of projects were determined and using a waited average to display an overall status didn’t make sense from an end-user perspective.

     

    After the variables were defined, the XSL output was something like this:

    <table>
      <tr>
    	<xsl:if test="($GreenPercent*100)&gt;'0'"><td width="{($GreenPercent*100)}%" bgcolor="green" align="center"><xsl:value-of select="$Green" /></td></xsl:if>
    	<xsl:if test="($YellowPercent*100)&gt;'0'"><td width="{($YellowPercent*100)}%" bgcolor="yellow" align="center"><xsl:value-of select="$Yellow" /></td></xsl:if>
    	<xsl:if test="($RedPercent*100)&gt;'0'"><td width="{($RedPercent*100)}%" bgcolor="red" align="center"><xsl:value-of select="$Red" /></td></xsl:if>
      </tr>
    </table>
    

     

    All the best,

    Mike

  • 2009년 7월 3일 금요일 오후 1:15SP RAJ 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     제안된 답변
    Hi Mikey,

    As I understood that you have a list like

    Project Name           Manager              Status

    abc                              A                          50
    xyz                              B                          30
    mno                            C                          45
    pqr                              A                          70
    lkj                               C                          20

    Manger can work on 'n' no.of projects

    What I mean to say is Create a custom webpart, populate Mangers column with distinct values (mangers can be duplicate) into a drop down list, then read the ddl values one by one, then using CAML query (<OrderBy><FieldRef Name='Manager' /><FieldRef Name='Status' /></OrderBy><Where><Eq><FieldRef Name='Manager' /><Value Type='Text'><here goes your ddl value filled with manager names> </Value></Eq></Where>) get one managers data.

    Then after pick the Status   column value and sum the status value if the query count is 2 or more, then calculate average Total/No.of row count (store the sum and average in a variable)

    Then you can insert the row into a fresh custom list.

    Let me know in case if you have any queries.
    • 답변으로 제안됨SP RAJ 2009년 7월 14일 화요일 오전 5:21
    •