繁体   English   中英

在pentaho报表设计器中,我如何检查多值参数为空还是null?

[英]How In pentaho report designer I want to check if multivalue parameter is empty or null?

我的参数定义:

        <list-parameter name="Direction" allow-multi-selection="true" strict-values="true" mandatory="false" type="[Ljava.lang.String;" query="DirectionQuery" key-column="BC_CALL_CLASSIFICATION_DIM_DIRECTION_NAME" value-column="BC_CALL_CLASSIFICATION_DIM_DIRECTION_NAME">
        <attribute namespace="http://reporting.pentaho.org/namespaces/engine/parameter-attributes/core" name="role">user</attribute>
        <attribute namespace="http://reporting.pentaho.org/namespaces/engine/parameter-attributes/core" name="parameter-render-type">list</attribute>
        <attribute namespace="http://reporting.pentaho.org/namespaces/engine/parameter-attributes/core" name="label">Direction</attribute>
        <attribute namespace="http://reporting.pentaho.org/namespaces/engine/parameter-attributes/core" name="hidden">false</attribute>

约束部分在我的MQL查询中

<constraint>
  <operator>AND</operator>
  <condition>OR( ISNA([param:Destination Type]);EQUALS([BC_FCT_CALLS.BC_NUMBER_CLASSIFICATION_DIM_CLASSIFICATION];[param:Destination Type]))</condition>
</constraint>
<constraint>
  <operator>AND</operator>
  <condition>OR(COUNTA([param:Direction]) == 0 ;EQUALS([BC_FCT_CALLS.BC_CALL_CLASSIFICATION_DIM_DIRECTION_NAME];[param:Direction]))</condition>
</constraint>

第一个约束有效,因为参数是单个值,但是第二个约束给我一条消息,不支持CONTA,如果用户选择多个值,则ISNA不起作用。

我找到了一种方法,对于每个多值参数“ param1”,在“后处理器公式”中为新参数创建另一个隐藏的布尔参数“ param1_hidden”,请使用以下公式

 =(COUNTA([param1]) = 0 )

现在在您的查询中

OR( EQUALS(TRUE();[param:param1_hidden);EQUALS([TABLE.COLUMN];[param:param1,]))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM