简体   繁体   中英

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?

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.

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 :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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