简体   繁体   English

如何在Pentaho Report Designer的开放式公式中使用多个条件?

[英]How to Use Multiple Condition in Open Formula in Pentaho Report Designer?

For single condition it is correct but if there is multiple condition hard to customize in open formula. 对于单个条件,这是正确的,但是如果存在多个条件,则很难在开放式公式中进行自定义。 For example i want grading like A,B,C .I did such but doesn't work? 例如,我想像A,B,C一样进行评分。我这样做了,但是行不通吗?

Code tried: 尝试的代码:

=IF([total]>90;"A";0 IF(OR([total]<80 ; [total]<=90);"B";0; IF(OR([total]<60 ; [total]<=70);"C";0; )))

Try the below in the open formula section: 在开放式公式部分尝试以下操作:

=IF([total]>90;"A";IF(OR([total]<80 ; [total]<=90);"B";"C"))

Since there is a nested looping condition you would need to place the inner condition inside the ELSE part of the Outer Condition. 由于存在嵌套循环条件,因此您需要将内部条件放置在外部条件的ELSE部分内。

Also i assume you need to display the grade against the marks scored by a student. 我还假设您需要根据学生打分的分数显示成绩。 So You can take a "Label" into the details section of the report. 因此,您可以将“标签”放入报告的详细信息部分。 Open the Attribute section of the label and inside the value part, use the above formula. 打开标签的“ 属性”部分,然后在部分内部,使用上面的公式。 Check the image below: (highlighted) 检查下面的图像:( 突出显示) 在此处输入图片说明

Hope it helps :) 希望能帮助到你 :)

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

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