|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Subtotalling issue in XSL
Hi all,
I have an issue with subtotalling in XSL that I cannot resolve. Hopefully someone can help me. I have a number of categories. Each has its own table and I have to subtotal it s values up to display a subtotal under the table. This is fine. However if the category is 'Mutual Funds', 'Bond Funds', 'Short-term Funds', 'Stock Funds' or 'Other', I have to display all these category details in one table called Mutual funds. I have this much done but I cant figure out the subtotalling of all these categories together. XSL snippet <!--Mutual Funds--> <xsl:if test="(contains($AllHoldings, 'Mutual Funds')) or (contains($AllHoldings, 'Stock Funds')) or (contains($AllHoldings, 'Bond Funds')) or (contains($AllHoldings, 'Short-term Funds')) or (contains($AllHoldings, 'Other')) "> <table cellspacing="0" width="684" summary="Mutual Funds" class="holdings grid"> <caption>Mutual Funds</caption> <xsl:call-template name="Headers"/> <xsl:for-each select="Account_Holding_Asset_Category"> <xsl:variable name="textBeforePercent" select="substring-before(Hld_Acct_Pcent_Fnte, '%')"/> <xsl:variable name="holdingsType" select="translate($textBeforePercent, '0123456789', '')"/> <xsl:if test="(($holdingsType = 'Mutual Funds ') or ($holdingsType = 'Stock Funds ') or ($holdingsType = 'Bond Funds ') or ($holdingsType = 'Short-term Funds ') or ($holdingsType = 'Other '))"> <xsl:apply-templates select="Account_Security_Holding_Detail"/> </xsl:if> </xsl:for-each> <tr class="total"> <td colspan="4">Subtotal of Mutual Funds</td> <td></td> <td><xsl:value-of select="sum(Account_Security_Holding_Detail/Hld_End_Sec_Mkt_Amt)"/></td> <td class="rb"> </td> </tr> </table> </xsl:if> XML snippet <Account_Holding_Asset_Category> <Hld_Acct_Pcent_Fnte>Mutual Funds 60% of holdings</Hld_Acct_Pcent_Fnte> <Account_Security_Holding_Detail> <Hld_Descr_Symb_Txt1>mfFIDELITY EQUITY INCOME ( FEQIX )</Hld_Descr_Symb_Txt1> <Hld_Sec_Qty_Amt>95306</Hld_Sec_Qty_Amt> <Hld_Sec_Prc_Amt>48.730</Hld_Sec_Prc_Amt> <Hld_Sec_Cost>4,726.80</Hld_Sec_Cost> <Hld_Beg_Sec_Mkt_Amt>4624.05</Hld_Beg_Sec_Mkt_Amt> <Hld_End_Sec_Mkt_Amt>4644.26</Hld_End_Sec_Mkt_Amt> </Account_Security_Holding_Detail> <Account_Security_Holding_Detail> <Hld_Descr_Symb_Txt1>mfFIDELITY FREEDOM 2010 ( FFFCX )</Hld_Descr_Symb_Txt1> <Hld_Sec_Qty_Amt>93131</Hld_Sec_Qty_Amt> <Hld_Sec_Prc_Amt>12.880</Hld_Sec_Prc_Amt> <Hld_Sec_Cost>unknown</Hld_Sec_Cost> <Hld_Beg_Sec_Mkt_Amt>1186.71</Hld_Beg_Sec_Mkt_Amt> <Hld_End_Sec_Mkt_Amt>1199.53</Hld_End_Sec_Mkt_Amt> </Account_Security_Holding_Detail> </Account_Holding_Asset_Category> <Account_Holding_Asset_Category> <Hld_Acct_Pcent_Fnte>Bond Funds 23% holdings</Hld_Acct_Pcent_Fnte> <Account_Security_Holding_Detail> <Hld_Descr_Symb_Txt1>mfBond Fund ( SMT )</Hld_Descr_Symb_Txt1> <Hld_Sec_Qty_Amt>4000</Hld_Sec_Qty_Amt> <Hld_Sec_Prc_Amt>$87.720</Hld_Sec_Prc_Amt> <Hld_Sec_Cost>$600.00</Hld_Sec_Cost> <Hld_Beg_Sec_Mkt_Amt>12.34</Hld_Beg_Sec_Mkt_Amt> <Hld_End_Sec_Mkt_Amt>9133.44</Hld_End_Sec_Mkt_Amt> </Account_Security_Holding_Detail> </Account_Holding_Asset_Category> <Account_Holding_Asset_Category> <Hld_Acct_Pcent_Fnte>Short-term Funds 4% holdings</Hld_Acct_Pcent_Fnte> <Account_Security_Holding_Detail> <Hld_Descr_Symb_Txt1>Short Term</Hld_Descr_Symb_Txt1> <Hld_Sec_Qty_Amt>2.000</Hld_Sec_Qty_Amt> <Hld_Sec_Prc_Amt>$47.720</Hld_Sec_Prc_Amt> <Hld_Sec_Cost>$0.00</Hld_Sec_Cost> <Hld_Beg_Sec_Mkt_Amt>97.34</Hld_Beg_Sec_Mkt_Amt> <Hld_End_Sec_Mkt_Amt>95.44</Hld_End_Sec_Mkt_Amt> </Account_Security_Holding_Detail> </Account_Holding_Asset_Category> Any help will be so much appreciated. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Subtotalling issue in XSL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|