XSL Query Sharepoint
Posted on 2009-07-07
I am trying to modify a query in my sharepoint Designer, and I cannot figure out the porper syntax:
this is the original syntax:
<xsl:value-of select="format-number(sum(/dsQueryResponse/NewDataSet/Row/@XTNDPRCE), '$#,##0.00;-$#,##0.00')" />
The query is basically a sum of the field "XTNDPRCE". The field contains numbers of my invoices or return Items, unfotunately my negative amount still shows positive by design so I need to put a "-" sign in front of each return amount. In order to figure out which item is negative I need to do a calculation that implies another field: SOPTYPE.
This formula will change the sign accordingly. ((-(@SOPTYPE*2-7)*(@XTNDPRCE))
This what I tried to do:
<xsl:value-of select="format-number(sum(/dsQueryResponse/NewDataSet/Row/ ((-(@SOPTYPE*2-7)*(@XTNDPRCE))), '$#,##0.00;-$#,##0.00')" /> but that doesn't work
How can I include the formula in my sum syntax ?
Thanks in Advanced. let me know if you want me to describe better.