title: Switching Math to %Reported from just a count of Present
body: <p><strong>Screenshot of tool</strong>
  <img src="https://i.stack.imgur.com/6fAJh.png" alt="1" /></p>
  <p>I have the following code that was written by another developer.  I have taken it as far as I can since I am not versed in XSLT.</p>
  <p>Currently the math is set to just do a percentage of just those that have marked themselves P (Present).  I want the percentage to count everything but NR (not reported), or just do a math equation where it counts the NR percentage and subtracts it from 100% - either way will work.</p>
  <p>Woolf CTR Sonia E
  4:47 PM (21 minutes ago)
  to me</p>
  <pre><code>&lt;xsl:output method=&quot;html&quot; indent=&quot;no&quot;/&gt;
  &lt;xsl:decimal-format NaN=&quot;&quot;/&gt;
  &lt;xsl:param name=&quot;dvt_apos&quot;&gt;&amp;apos;&lt;/xsl:param&gt;
  &lt;xsl:param name=&quot;dvt_groupfield&quot; /&gt;
  &lt;xsl:param name=&quot;ListName&quot;&gt;Morning Report&lt;/xsl:param&gt;
  &lt;xsl:param name=&quot;Day&quot; /&gt;
  &lt;xsl:param name=&quot;Monday&quot;&gt;=(2-WEEKDAY(Today)+(Today))&lt;/xsl:param&gt;
  &lt;xsl:variable name=&quot;dvt_1_automode&quot;&gt;0&lt;/xsl:variable&gt;
  
  &lt;xsl:template match=&quot;/&quot; xmlns:x=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:d=&quot;http://schemas.microsoft.com/sharepoint/dsp&quot; xmlns:asp=&quot;http://schemas.microsoft.com/ASPNET/20&quot; xmlns:__designer=&quot;http://schemas.microsoft.com/WebParts/v2/DataView/designer&quot; xmlns:SharePoint=&quot;Microsoft.SharePoint.WebControls&quot;&gt;
      &lt;xsl:call-template name=&quot;dvt_1&quot;/&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template name=&quot;dvt_1&quot;&gt;
                                          &lt;xsl:variable name=&quot;dvt_StyleName&quot;&gt;Table&lt;/xsl:variable&gt;
                                          &lt;xsl:variable name=&quot;Rows&quot; select=&quot;/dsQueryResponse/Rows/Row&quot;/&gt;
                                          &lt;xsl:variable name=&quot;dvt_RowCount&quot; select=&quot;count($Rows)&quot; /&gt;
                                          &lt;xsl:variable name=&quot;IsEmpty&quot; select=&quot;$dvt_RowCount = 0&quot; /&gt;
                                          &lt;table border=&quot;0&quot; width=&quot;100%&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot;&gt;
          &lt;tr valign=&quot;top&quot;&gt;
                          &lt;xsl:if test=&quot;$dvt_1_automode = '1'&quot; ddwrt:cf_ignore=&quot;1&quot;&gt;
                  &lt;th class=&quot;ms-vh&quot; width=&quot;1%&quot; nowrap=&quot;nowrap&quot;&gt;&lt;/th&gt;
              &lt;/xsl:if&gt;
              &lt;th class=&quot;ms-vh&quot; nowrap=&quot;&quot; style=&quot;width: 129px&quot;&gt;Name&lt;/th&gt;
              &lt;xsl:call-template name=&quot;table_header_query&quot;&gt;
                                                                          &lt;xsl:with-param name=&quot;Rows&quot; select=&quot;$Rows&quot;/&gt;
                                                          &lt;/xsl:call-template&gt;&lt;/tr&gt;
                                                          &lt;xsl:call-template name=&quot;dvt_1.body&quot;&gt;
                                                                          &lt;xsl:with-param name=&quot;Rows&quot; select=&quot;$Rows&quot;/&gt;
                                                                          &lt;xsl:with-param name=&quot;FirstRow&quot; select=&quot;1&quot; /&gt;
                                                                          &lt;xsl:with-param name=&quot;LastRow&quot; select=&quot;$dvt_RowCount&quot; /&gt;
                                                          &lt;/xsl:call-template&gt;
      
                                          &lt;xsl:call-template name=&quot;dvt_1.footer&quot;&gt;
                                                          &lt;xsl:with-param name=&quot;Rows&quot; select=&quot;$Rows&quot; /&gt;
                                          &lt;/xsl:call-template&gt;
                          &lt;/table&gt;
                          &lt;/xsl:template&gt;
  &lt;xsl:template name=&quot;dvt_1.body&quot;&gt;
                                          &lt;xsl:param name=&quot;Rows&quot;/&gt;
                                          &lt;xsl:param name=&quot;FirstRow&quot; /&gt;
                                          &lt;xsl:param name=&quot;LastRow&quot; /&gt;
                                          &lt;xsl:variable name=&quot;dvt_Rows&quot;&gt;&lt;root&gt;
                                                          &lt;xsl:for-each select=&quot;$Rows&quot;&gt;
                                                                          &lt;xsl:if test=&quot;(position() &amp;gt;= $FirstRow and position() &amp;lt;= $LastRow)&quot;&gt;&lt;xsl:copy-of select=&quot;.&quot; /&gt;&lt;/xsl:if&gt;
                                                          &lt;/xsl:for-each&gt;
                                                          &lt;/root&gt;&lt;/xsl:variable&gt;
                                          &lt;xsl:for-each select=&quot;$Rows&quot;&gt;
                                                          &lt;xsl:variable name=&quot;NewGroup_0&quot;&gt;
                                                                          &lt;xsl:choose&gt;
                                                                                          &lt;xsl:when test=&quot;not ($dvt_groupfield)&quot;&gt;&lt;xsl:value-of select=&quot;ddwrt:NameChanged(string(@PdM), 0)&quot; /&gt;&lt;/xsl:when&gt;
                                                                                          &lt;xsl:otherwise&gt;&lt;/xsl:otherwise&gt;
                                                                          &lt;/xsl:choose&gt;
                                                          &lt;/xsl:variable&gt;
                                                          &lt;xsl:choose&gt; 
                                                                          &lt;xsl:when test=&quot;0&quot; /&gt;
                                                                          &lt;xsl:when test=&quot;not($dvt_groupfield) and (not($NewGroup_0='') and position() &amp;gt;= $FirstRow and position() &amp;lt;= $LastRow or ($FirstRow = position()))&quot;&gt;
                                                                                          &lt;xsl:variable name=&quot;groupheader0&quot;&gt;
                                                                                                          &lt;xsl:choose&gt; 
                                                                                                                          &lt;xsl:when test=&quot;not (@PdM) and (@PdM) != false()&quot;&gt;&lt;xsl:value-of select=&quot;' '&quot; /&gt;&lt;/xsl:when&gt;
                                                                                                                          &lt;xsl:otherwise&gt;&lt;xsl:value-of select=&quot;@PdM&quot; /&gt;&lt;/xsl:otherwise&gt;
                                                                                                          &lt;/xsl:choose&gt;
                                                                                          &lt;/xsl:variable&gt;
                                                                                          &lt;xsl:variable name=&quot;groupfooter0&quot;&gt;
                                                                                                          &lt;xsl:choose&gt; 
                                                                                                                          &lt;xsl:when test=&quot;$NewGroup_0=''&quot;&gt;&lt;xsl:value-of select=&quot;@PdM&quot; /&gt;&lt;/xsl:when&gt;
                                                                                                                          &lt;xsl:otherwise&gt;&lt;xsl:value-of select=&quot;$NewGroup_0&quot; /&gt;&lt;/xsl:otherwise&gt;
                                                                                                          &lt;/xsl:choose&gt;
                                                                                          &lt;/xsl:variable&gt;
                                                                                          &lt;xsl:if test=&quot;not ((position()=1) or (position()=$FirstRow))&quot;&gt;
                                                                                                          &lt;xsl:call-template name=&quot;dvt_1.groupfooter0&quot;&gt;
                                                                                                                          &lt;xsl:with-param name=&quot;fieldtitle&quot;&gt;Org&lt;/xsl:with-param&gt;
                                                                                                                          &lt;xsl:with-param name=&quot;fieldname&quot;&gt;PdM&lt;/xsl:with-param&gt;
                                                                                                                          &lt;xsl:with-param name=&quot;fieldvalue&quot; select=&quot;$groupfooter0&quot; /&gt;
                                                                                                                          &lt;xsl:with-param name=&quot;fieldtype&quot; select=&quot;''&quot; /&gt;
                                                                                                                          &lt;xsl:with-param name=&quot;nodeset&quot; select=&quot;msxsl:node-set($dvt_Rows)/root//Row[((@PdM)=$groupfooter0 or ((not(@PdM) or @PdM='') and $groupfooter0=' '))]&quot; /&gt;
                                                                                                                          &lt;xsl:with-param name=&quot;groupid&quot; select=&quot;'0'&quot; /&gt;
                                                                                                                          &lt;xsl:with-param name=&quot;displaystyle&quot; select=&quot;'auto'&quot; /&gt;
                                                                                                                          &lt;xsl:with-param name=&quot;showfooter&quot; select=&quot;true()&quot; /&gt;
                                                                                                                          &lt;xsl:with-param name=&quot;showfootercolumn&quot; select=&quot;false()&quot; /&gt;
                                                                                                          &lt;/xsl:call-template&gt;
                                                                                          &lt;/xsl:if&gt;
                                                                                          &lt;xsl:call-template name=&quot;dvt_1.groupheader0&quot;&gt;
                                                                                                          &lt;xsl:with-param name=&quot;fieldtitle&quot;&gt;Org&lt;/xsl:with-param&gt;
                                                                                                          &lt;xsl:with-param name=&quot;fieldname&quot;&gt;PdM&lt;/xsl:with-param&gt;
                                                                                                          &lt;xsl:with-param name=&quot;fieldvalue&quot; select=&quot;$groupheader0&quot; /&gt;
                                                                                                          &lt;xsl:with-param name=&quot;fieldtype&quot; select=&quot;''&quot; /&gt;
                                                                                                          &lt;xsl:with-param name=&quot;nodeset&quot; select=&quot;msxsl:node-set($dvt_Rows)/root//Row[((@PdM)=$groupheader0 or ((not(@PdM) or @PdM='') and $groupheader0=' '))]&quot; /&gt;
                                                                                                          &lt;xsl:with-param name=&quot;groupid&quot; select=&quot;'0'&quot; /&gt;
                                                                                                          &lt;xsl:with-param name=&quot;displaystyle&quot; select=&quot;'auto'&quot; /&gt;
                                                                                                          &lt;xsl:with-param name=&quot;imagesrc&quot; select=&quot;'/_layouts/images/plus.gif'&quot; /&gt;
                                                                                                          &lt;xsl:with-param name=&quot;alttext&quot; select=&quot;'expand'&quot; /&gt;
                                                                                                          &lt;xsl:with-param name=&quot;altname&quot; select=&quot;'collapse'&quot; /&gt;
                                                                                                          &lt;xsl:with-param name=&quot;hidedetail&quot; select=&quot;false()&quot; /&gt;
                                                                                                          &lt;xsl:with-param name=&quot;showheader&quot; select=&quot;true()&quot; /&gt;
                                                                                                          &lt;xsl:with-param name=&quot;showheadercolumn&quot; select=&quot;false()&quot; /&gt;
                                                                                          &lt;/xsl:call-template&gt;
                                                                          &lt;/xsl:when&gt;
                                                          &lt;/xsl:choose&gt;
                                                          
                                                          
                                                          &lt;xsl:variable name=&quot;BreakOut&quot;&gt;
                                                                          &lt;xsl:choose&gt;
                                                                                          &lt;xsl:when test=&quot;not($dvt_groupfield) and position()=$LastRow+1&quot;&gt;&lt;xsl:value-of select=&quot;ddwrt:NameChanged('', -1)&quot; /&gt;&lt;/xsl:when&gt;
                                                                                          &lt;xsl:otherwise&gt;BreakOut&lt;/xsl:otherwise&gt;
                                                                          &lt;/xsl:choose&gt;
                                                          &lt;/xsl:variable&gt;
                                                          
                                                          
                                                          &lt;xsl:variable name=&quot;dvt_KeepItemsTogether&quot; select=&quot;false()&quot; /&gt;
                                                          &lt;xsl:variable name=&quot;dvt_HideGroupDetail&quot; select=&quot;false()&quot; /&gt;
                                                          &lt;xsl:if test=&quot;(position() &amp;gt;= $FirstRow and position() &amp;lt;= $LastRow) or $dvt_KeepItemsTogether&quot;&gt;
                                                                          &lt;xsl:if test=&quot;not($dvt_HideGroupDetail)&quot; ddwrt:cf_ignore=&quot;1&quot;&gt;
                                                                                          &lt;xsl:call-template name=&quot;dvt_1.rowview&quot; /&gt;
                                                                          &lt;/xsl:if&gt;
                                                          &lt;/xsl:if&gt;
                                                          &lt;xsl:choose&gt; 
                                                                          &lt;xsl:when test=&quot;0&quot; /&gt;
                                                                          &lt;xsl:when test=&quot;($NewGroup_0 or true()) and not($dvt_groupfield)&quot;&gt;
                                                                                          &lt;xsl:variable name=&quot;groupfooter0&quot;&gt;
                                                                                                          &lt;xsl:choose&gt; 
                                                                                                                          &lt;xsl:when test=&quot;position() = count($Rows) and ($LastRow &amp;gt;= position() or $dvt_KeepItemsTogether) or not($NewGroup_0) or $NewGroup_0=''&quot;&gt;&lt;xsl:value-of select=&quot;@PdM&quot; /&gt;&lt;/xsl:when&gt;
                                                                                                                           &lt;xsl:otherwise&gt;&lt;xsl:value-of select=&quot;$NewGroup_0&quot; /&gt;&lt;/xsl:otherwise&gt;
                                                                                                          &lt;/xsl:choose&gt;
                                                                                          &lt;/xsl:variable&gt;
                                                                                          &lt;xsl:if test=&quot;(position() = count($Rows) and ($LastRow=position() or $dvt_KeepItemsTogether)) or (not($dvt_KeepItemsTogether)  and position() &amp;gt; $LastRow and not($BreakOut='BreakOut')) or (not($dvt_KeepItemsTogether) and position() = $LastRow+1) or (position()=last() and $LastRow &amp;gt; last())&quot;&gt;
                                                                                                          &lt;xsl:call-template name=&quot;dvt_1.groupfooter0&quot;&gt;
                                                                                                                          &lt;xsl:with-param name=&quot;fieldtitle&quot;&gt;Org&lt;/xsl:with-param&gt;
                                                                                                                          &lt;xsl:with-param name=&quot;fieldname&quot;&gt;PdM&lt;/xsl:with-param&gt;
                                                                                                                          &lt;xsl:with-param name=&quot;fieldvalue&quot; select=&quot;$groupfooter0&quot; /&gt;
                                                                                                                          &lt;xsl:with-param name=&quot;fieldtype&quot; select=&quot;''&quot; /&gt;
                                                                                                                          &lt;xsl:with-param name=&quot;nodeset&quot; select=&quot;msxsl:node-set($dvt_Rows)/root//Row[((@PdM)=$groupfooter0 or ((not(@PdM) or @PdM='') and $groupfooter0=' '))]&quot; /&gt;
                                                                                                                          &lt;xsl:with-param name=&quot;groupid&quot; select=&quot;'0'&quot; /&gt;
                                                                                                                          &lt;xsl:with-param name=&quot;displaystyle&quot; select=&quot;'auto'&quot; /&gt;
                                                                                                                          &lt;xsl:with-param name=&quot;showfooter&quot; select=&quot;true()&quot; /&gt;
                                                                                                                          &lt;xsl:with-param name=&quot;showfootercolumn&quot; select=&quot;false()&quot; /&gt;
                                                                                                          &lt;/xsl:call-template&gt;
                                                                                          &lt;/xsl:if&gt;
                                                                          &lt;/xsl:when&gt;
                                                          &lt;/xsl:choose&gt;
                                                      
                                          &lt;/xsl:for-each&gt;
                                          
  &lt;/xsl:template&gt;
  &lt;xsl:template name=&quot;dvt_1.rowview&quot;&gt;
                                          &lt;xsl:variable name=&quot;dvt_GroupStyle&quot; select=&quot;'none'&quot; /&gt;
                                          &lt;tr style=&quot;display:{$dvt_GroupStyle}&quot;&gt;
                                                          &lt;xsl:if test=&quot;position() mod 2 = 1&quot;&gt;
                                                                          &lt;xsl:attribute name=&quot;class&quot;&gt;ms-alternating&lt;/xsl:attribute&gt;
          &lt;/xsl:if&gt;
                                                          &lt;xsl:if test=&quot;$dvt_1_automode = '1'&quot; ddwrt:cf_ignore=&quot;1&quot;&gt;
              &lt;td class=&quot;ms-vb&quot; width=&quot;1%&quot; nowrap=&quot;nowrap&quot;&gt;
                  &lt;span ddwrt:amkeyfield=&quot;ID&quot; ddwrt:amkeyvalue=&quot;ddwrt:EscapeDelims(string(@ID))&quot; ddwrt:ammode=&quot;view&quot;&gt;&lt;/span&gt;
              &lt;/td&gt;
          &lt;/xsl:if&gt;
          &lt;xsl:variable name=&quot;monLoc&quot; select=&quot;@Mon_x005F_x0020_Location&quot;/&gt;
          &lt;xsl:variable name=&quot;tuesLoc&quot; select=&quot;@Tues_x005F_x0020_Location&quot;/&gt;
          &lt;xsl:variable name=&quot;wedLoc&quot; select=&quot;@Wed_x005F_x0020_Location&quot;/&gt;
          &lt;xsl:variable name=&quot;thursLoc&quot; select=&quot;@Thurs_x005F_x0020_Location&quot;/&gt;
          &lt;xsl:variable name=&quot;friLoc&quot; select=&quot;@Fri_x005F_x0020_Location&quot;/&gt;
          &lt;xsl:variable name=&quot;listLocation&quot; select=&quot;string-length(substring-before(@FileRef, 'sites'))&quot;/&gt;
          &lt;xsl:variable name=&quot;locationStripped&quot;&gt;
              &lt;xsl:call-template name=&quot;SubstringBeforeLast&quot;&gt;
                  &lt;xsl:with-param name=&quot;String&quot; select=&quot;@FileRef&quot;/&gt;
                  &lt;xsl:with-param name=&quot;Char&quot; select=&quot;'/'&quot;/&gt;
              &lt;/xsl:call-template&gt;
  
          &lt;/xsl:variable&gt;
          &lt;xsl:variable name=&quot;editURL&quot; select=&quot;concat('/', substring($locationStripped, $listLocation+1), '/EditForm.aspx?ID=', @ID)&quot;/&gt;           
          &lt;td class=&quot;ms-vb&quot;&gt;
              &lt;a href=&quot;{$editURL}&quot;
                  onclick=&quot;GoToLink(this);return false;&quot;
                  target=&quot;_self&quot;&gt;
                  &lt;xsl:value-of select=&quot;substring-after(@UserName, ';#')&quot; disable-output-escaping=&quot;yes&quot;/&gt;
              &lt;/a&gt;
              
          &lt;/td&gt;&lt;td class=&quot;ms-vb&quot; title=&quot;{$monLoc}&quot;&gt;&lt;xsl:call-template name=&quot;color_reported&quot;&gt;
                                                          &lt;xsl:with-param name=&quot;status&quot;&gt;&lt;xsl:value-of select=&quot;@Mon_x005F_x0020_Status&quot; /&gt;&lt;/xsl:with-param&gt;
                  &lt;/xsl:call-template&gt;
  
              &lt;xsl:value-of select=&quot;@Mon_x005F_x0020_Status&quot; /&gt;&lt;/td&gt;&lt;td class=&quot;ms-vb&quot; title=&quot;{$tuesLoc}&quot;&gt;&lt;xsl:call-template name=&quot;color_reported&quot;&gt;
                                                          &lt;xsl:with-param name=&quot;status&quot;&gt;&lt;xsl:value-of select=&quot;@Tues_x005F_x0020_Status&quot; /&gt;&lt;/xsl:with-param&gt;
                  &lt;/xsl:call-template&gt;
              &lt;xsl:value-of select=&quot;@Tues_x005F_x0020_Status&quot; /&gt;&lt;/td&gt;&lt;td class=&quot;ms-vb&quot; title=&quot;{$wedLoc}&quot;&gt;&lt;xsl:call-template name=&quot;color_reported&quot;&gt;
                                                          &lt;xsl:with-param name=&quot;status&quot;&gt;&lt;xsl:value-of select=&quot;@Wed_x005F_x0020_Status&quot; /&gt;&lt;/xsl:with-param&gt;
                  &lt;/xsl:call-template&gt;
              &lt;xsl:value-of select=&quot;@Wed_x005F_x0020_Status&quot; /&gt;&lt;/td&gt;&lt;td class=&quot;ms-vb&quot; title=&quot;{$thursLoc}&quot;&gt;&lt;xsl:call-template name=&quot;color_reported&quot;&gt;
                                                          &lt;xsl:with-param name=&quot;status&quot;&gt;&lt;xsl:value-of select=&quot;@Thurs_x005F_x0020_Status&quot; /&gt;&lt;/xsl:with-param&gt;
                  &lt;/xsl:call-template&gt;
              &lt;xsl:value-of select=&quot;@Thurs_x005F_x0020_Status&quot; /&gt;&lt;/td&gt;&lt;td class=&quot;ms-vb&quot; title=&quot;{$friLoc}&quot;&gt;&lt;xsl:call-template name=&quot;color_reported&quot;&gt;
                                                          &lt;xsl:with-param name=&quot;status&quot;&gt;&lt;xsl:value-of select=&quot;@Fri_x005F_x0020_Status&quot; /&gt;&lt;/xsl:with-param&gt;
                  &lt;/xsl:call-template&gt;
              &lt;xsl:value-of select=&quot;@Fri_x005F_x0020_Status&quot; /&gt;&lt;/td&gt;
                              &lt;/tr&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template name=&quot;dvt_1.groupheader0&quot;&gt;
                                          &lt;xsl:param name=&quot;fieldtitle&quot; /&gt;
                                          &lt;xsl:param name=&quot;fieldname&quot; /&gt;
                                          &lt;xsl:param name=&quot;fieldvalue&quot; /&gt;
                                          &lt;xsl:param name=&quot;fieldtype&quot; /&gt;
                                          &lt;xsl:param name=&quot;nodeset&quot; /&gt;
                                          &lt;xsl:param name=&quot;groupid&quot; /&gt;
                                          &lt;xsl:param name=&quot;displaystyle&quot; /&gt;
                                          &lt;xsl:param name=&quot;imagesrc&quot; /&gt;
                                          &lt;xsl:param name=&quot;alttext&quot; /&gt;
                                          &lt;xsl:param name=&quot;altname&quot; /&gt;
                                          &lt;xsl:param name=&quot;hidedetail&quot; /&gt;
                                          &lt;xsl:param name=&quot;showheader&quot; /&gt;
                                          &lt;xsl:param name=&quot;showheadercolumn&quot; /&gt;
                                          &lt;xsl:if test=&quot;$showheader&quot; ddwrt:cf_ignore=&quot;1&quot;&gt;
          &lt;tr id=&quot;group{$groupid}&quot; style=&quot;display:{$displaystyle}&quot;&gt;
              &lt;td class=&quot;ms-gb&quot; style=&quot;background:#cccccc;&quot; colspan=&quot;8&quot;&gt;
                  &lt;xsl:choose&gt;
                                  &lt;xsl:when test=&quot;$groupid='0' or $groupid='9'&quot;&gt;
                                                  &lt;xsl:text&gt;&lt;/xsl:text&gt;
                                  &lt;/xsl:when&gt;
                                  &lt;xsl:when test=&quot;$groupid='1'&quot;&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                  &lt;/xsl:when&gt;
                                  &lt;xsl:when test=&quot;$groupid='2'&quot;&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                  &lt;/xsl:when&gt;
                                  &lt;xsl:when test=&quot;$groupid='3'&quot;&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                  &lt;/xsl:when&gt;
                                  &lt;xsl:when test=&quot;$groupid='4'&quot;&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                  &lt;/xsl:when&gt;
                                  &lt;xsl:when test=&quot;$groupid='5'&quot;&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                  &lt;/xsl:when&gt;
                                  &lt;xsl:when test=&quot;$groupid='6'&quot;&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                  &lt;/xsl:when&gt;
                  &lt;/xsl:choose&gt;
                  &lt;xsl:if test=&quot;not($hidedetail)&quot; ddwrt:cf_ignore=&quot;1&quot;&gt;
                      &lt;a href=&quot;javascript:&quot; onclick=&quot;javascript:ExpGroupBy(this);return false;&quot;&gt;
                          &lt;img src=&quot;{$imagesrc}&quot; border=&quot;0&quot; alt=&quot;{$alttext}&quot; name=&quot;{$altname}&quot; /&gt;&lt;/a&gt;
                  &lt;/xsl:if&gt;
                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot; xmlns:ddwrt=&quot;http://schemas.microsoft.com/WebParts/v2/DataView/runtime&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                  
                  &lt;xsl:if test=&quot;$fieldvalue!='PMO'&quot;&gt;
                  &lt;b&gt;
                      &lt;xsl:value-of select=&quot;$fieldtitle&quot; /&gt;
                  &lt;/b&gt;
                  &lt;xsl:if test=&quot;$fieldtitle&quot;&gt;: &lt;/xsl:if&gt;
                  &lt;/xsl:if&gt;
                  &lt;xsl:choose&gt;
                                  &lt;xsl:when test=&quot;$fieldtype='url'&quot;&gt;
                          &lt;a href=&quot;{$fieldvalue}&quot;&gt;
                              &lt;xsl:value-of select=&quot;$fieldvalue&quot; /&gt;
                          &lt;/a&gt;
                      &lt;/xsl:when&gt;
                                  &lt;xsl:when test=&quot;$fieldtype='user'&quot;&gt;
                          &lt;xsl:value-of select=&quot;$fieldvalue&quot; disable-output-escaping=&quot;yes&quot; /&gt;
                      &lt;/xsl:when&gt;
                                  &lt;xsl:otherwise&gt;
                          &lt;xsl:value-of select=&quot;$fieldvalue&quot; /&gt;
                      &lt;/xsl:otherwise&gt;
                  &lt;/xsl:choose&gt;
                          &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/xsl:if&gt;
                          &lt;/xsl:template&gt;
  &lt;xsl:template name=&quot;dvt_1.groupfooter0&quot;&gt;
                  &lt;xsl:param name=&quot;fieldtitle&quot; /&gt;
                  &lt;xsl:param name=&quot;fieldname&quot; /&gt;
                  &lt;xsl:param name=&quot;fieldvalue&quot; /&gt;
                  &lt;xsl:param name=&quot;fieldtype&quot; /&gt;
                  &lt;xsl:param name=&quot;nodeset&quot; /&gt;
                  &lt;xsl:param name=&quot;groupid&quot; /&gt;
                  &lt;xsl:param name=&quot;displaystyle&quot; /&gt;
                  &lt;xsl:param name=&quot;showfooter&quot; /&gt;
                  &lt;xsl:param name=&quot;showfootercolumn&quot; /&gt;
                  &lt;xsl:if test=&quot;$showfooter&quot; ddwrt:cf_ignore=&quot;1&quot;&gt;
          &lt;tr id=&quot;group{$groupid}&quot; style=&quot;display:{$displaystyle}&quot;&gt;
              &lt;td class=&quot;ms-gb&quot; style=&quot;background:#cccccc;&quot; colspan=&quot;1&quot; align=&quot;right&quot;&gt;
                  &lt;xsl:choose&gt;
                                  &lt;xsl:when test=&quot;$groupid='0' or $groupid='9'&quot;&gt;&lt;/xsl:when&gt;
                                  &lt;xsl:when test=&quot;$groupid='1'&quot;&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                  &lt;/xsl:when&gt;
                                  &lt;xsl:when test=&quot;$groupid='2'&quot;&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                  &lt;/xsl:when&gt;
                                  &lt;xsl:otherwise&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                                  &lt;xsl:text disable-output-escaping=&quot;yes&quot; ddwrt:nbsp-preserve=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
                                  &lt;/xsl:otherwise&gt;
                  &lt;/xsl:choose&gt;
                  &lt;b&gt;&lt;u&gt;%Reported&lt;/u&gt;
                  &lt;/b&gt;
              &lt;/td&gt;
              &lt;td class=&quot;ms-gb&quot;&gt;
                  &lt;xsl:call-template name=&quot;color_present&quot;&gt;
                      &lt;xsl:with-param name=&quot;present&quot;&gt;&lt;xsl:value-of select=&quot;count($nodeset[@Mon_x005F_x0020_Status!='NR']) div count($nodeset)&quot; /&gt;&lt;/xsl:with-param&gt;
                  &lt;/xsl:call-template&gt;
  
                  &lt;xsl:value-of select=&quot;format-number(count($nodeset[@Mon_x005F_x0020_Status!='NR']) div count($nodeset), '0%')&quot; /&gt;&lt;/td&gt;
              &lt;td class=&quot;ms-gb&quot;&gt;
              &lt;xsl:call-template name=&quot;color_present&quot;&gt;
                      &lt;xsl:with-param name=&quot;present&quot;&gt;&lt;xsl:value-of select=&quot;count($nodeset[@Tues_x005F_x0020_Status!='NR']) div count($nodeset)&quot; /&gt;&lt;/xsl:with-param&gt;
                  &lt;/xsl:call-template&gt;
                  &lt;xsl:value-of select=&quot;format-number(count($nodeset[@Tues_x005F_x0020_Status!='NR']) div count($nodeset), '0%')&quot; /&gt;&lt;/td&gt;
              &lt;td class=&quot;ms-gb&quot;&gt;
              &lt;xsl:call-template name=&quot;color_present&quot;&gt;
                      &lt;xsl:with-param name=&quot;present&quot;&gt;&lt;xsl:value-of select=&quot;count($nodeset[@Wed_x005F_x0020_Status!='NR']) div count($nodeset)&quot; /&gt;&lt;/xsl:with-param&gt;
                  &lt;/xsl:call-template&gt;
                  &lt;xsl:value-of select=&quot;format-number(count($nodeset[@Wed_x005F_x0020_Status!='NR']) div count($nodeset), '0%')&quot; /&gt;&lt;/td&gt;
              &lt;td class=&quot;ms-gb&quot;&gt;
              &lt;xsl:call-template name=&quot;color_present&quot;&gt;
                      &lt;xsl:with-param name=&quot;present&quot;&gt;&lt;xsl:value-of select=&quot;count($nodeset[@Thurs_x005F_x0020_Status!='NR']) div count($nodeset)&quot; /&gt;&lt;/xsl:with-param&gt;
                  &lt;/xsl:call-template&gt;
                  &lt;xsl:value-of select=&quot;format-number(count($nodeset[@Thurs_x005F_x0020_Status!='NR']) div count($nodeset), '0%')&quot; /&gt;&lt;/td&gt;
              &lt;td class=&quot;ms-gb&quot;&gt;
              &lt;xsl:call-template name=&quot;color_present&quot;&gt;
                      &lt;xsl:with-param name=&quot;present&quot;&gt;&lt;xsl:value-of select=&quot;count($nodeset[@Fri_x005F_x0020_Status!='NR']) div count($nodeset)&quot; /&gt;&lt;/xsl:with-param&gt;
                  &lt;/xsl:call-template&gt;
                  &lt;xsl:value-of select=&quot;format-number(count($nodeset[@Fri_x005F_x0020_Status!='NR']) div count($nodeset), '0%')&quot; /&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/xsl:if&gt;
  &lt;/xsl:template&gt;
  &lt;xsl:template name=&quot;dvt_1.footer&quot;&gt;
                  &lt;xsl:param name=&quot;Rows&quot; /&gt;
          
          &lt;tr &gt;
              &lt;td class=&quot;ms-vh&quot; style=&quot;color:black; width: 129px;&quot; align=&quot;right&quot;&gt;&lt;b&gt;&lt;u&gt;Org Totals&lt;/u&gt;&lt;/b&gt;&lt;/td&gt;
              &lt;td class=&quot;ms-vh&quot; colspan=&quot;8&quot;&gt;&lt;/td&gt;
          &lt;/tr&gt;
          
          &lt;xsl:variable name=&quot;presMon&quot; select=&quot;count(/dsQueryResponse/Rows/Row[@Mon_x005F_x0020_Status='P'])&quot; /&gt;
          &lt;xsl:variable name=&quot;presTues&quot; select=&quot;count(/dsQueryResponse/Rows/Row[@Tues_x005F_x0020_Status='P'])&quot; /&gt;
          &lt;xsl:variable name=&quot;presWed&quot; select=&quot;count(/dsQueryResponse/Rows/Row[@Wed_x005F_x0020_Status='P'])&quot; /&gt;
          &lt;xsl:variable name=&quot;presThurs&quot; select=&quot;count(/dsQueryResponse/Rows/Row[@Thurs_x005F_x0020_Status='P'])&quot; /&gt;
          &lt;xsl:variable name=&quot;presFri&quot; select=&quot;count(/dsQueryResponse/Rows/Row[@Fri_x005F_x0020_Status='P'])&quot; /&gt;
  
          &lt;tr &gt;
              &lt;td class=&quot;ms-vb&quot; align=&quot;right&quot; style=&quot;width: 129px&quot;&gt;&lt;u&gt;O/H&lt;/u&gt;&lt;/td&gt;
              &lt;td class=&quot;ms-vb&quot;&gt;&lt;xsl:value-of select=&quot;$presMon&quot; /&gt;&lt;/td&gt;
              &lt;td class=&quot;ms-vb&quot;&gt;&lt;xsl:value-of select=&quot;$presTues&quot; /&gt;&lt;/td&gt;
              &lt;td class=&quot;ms-vb&quot;&gt;&lt;xsl:value-of select=&quot;$presWed&quot; /&gt;&lt;/td&gt;
              &lt;td class=&quot;ms-vb&quot; style=&quot;width: 13px&quot;&gt;&lt;xsl:value-of select=&quot;$presThurs&quot; /&gt;&lt;/td&gt;
              &lt;td class=&quot;ms-vb&quot;&gt;&lt;xsl:value-of select=&quot;$presFri&quot; /&gt;&lt;/td&gt;&lt;td class=&quot;ms-vb&quot; style=&quot;width: 26px&quot;&gt;
              &lt;xsl:text xmlns:ddwrt=&quot;http://schemas.microsoft.com/WebParts/v2/DataView/runtime&quot; ddwrt:nbsp-preserve=&quot;yes&quot; disable-output-escaping=&quot;yes&quot;&gt;&amp;amp;nbsp;&lt;/xsl:text&gt;
              &lt;/td&gt;&lt;/tr&gt;
          
          &lt;xsl:variable name=&quot;offMon&quot; select=&quot;count(/dsQueryResponse/Rows/Row[@Mon_x005F_x0020_Status='O'])&quot; /&gt;
          &lt;xsl:variable name=&quot;offTues&quot; select=&quot;count(/dsQueryResponse/Rows/Row[@Tues_x005F_x0020_Status='O'])&quot; /&gt;
          &lt;xsl:variable name=&quot;offWed&quot; select=&quot;count(/dsQueryResponse/Rows/Row[@Wed_x005F_x0020_Status='O'])&quot; /&gt;
          &lt;xsl:variable name=&quot;offThurs&quot; select=&quot;count(/dsQueryResponse/Rows/Row[@Thurs_x005F_x0020_Status='O'])&quot; /&gt;
          &lt;xsl:variable name=&quot;offFri&quot; select=&quot;count(/dsQueryResponse/Rows/Row[@Fri_x005F_x0020_Status='O'])&quot; /&gt;
          &lt;xsl:if test=&quot;($offMon + $offTues + $offWed + $offThurs + $offFri) != 0&quot;&gt;
  </code></pre>