条件中的求和字段(IF 字段 = 'something'则总和(字段) - BI 发布者



我需要根据RTF格式上BI Publisher的条件求和值。这就是我们的目的:IF FIELD1 = 'THIS' THEN SUM(FIELD2)

到目前为止,我有当前的公式:

if FIELD = 'THIS' THEN 'N/A?其他金额(FIELD2)如果

问题是求和不起作用。当它应该是其他值时,它对每个结果返回0。N/A部分没问题。

我怎样才能做到这一点?

你可以选择,或者像这样:

<xsl:choose>
<xsl:when test="your_test_node > 20">
<td>
<xsl:value-of select="sum(your_node)"/>
</td>
</xsl:when>
<xsl:otherwise>
<td>
<xsl:value-of select="sum(your_other_node)"/>
</td>
</xsl:otherwise>
</xsl:choose>

<xsl:if test="your_test_node &gt; 20">
<td>
<xsl:value-of select="sum(your_node)"/>
</td>
</xsl:if>

如果你只想在检查一个条件后求和那么我就会在RTF模板中这样做:

<?if:condition='this'?> <?sum(variable)?> <?end if?> 

或者你可以像这样使用if else:

<?xdofx:if condition='this' then sum(this) else result2 end if?>

最新更新