Jump to content
Changes to the Jaspersoft community edition download ×

Case Statement in Jaspersoft Domain Calculated field?


robert.j

Recommended Posts

Dear All,

I am trying to create a domain calculated field that has case statement, i am trying the below statement for the calculated field

case
when column1*Column2*Column3/1000000000*2.5*to_number(substr(Column4,2,3)) between 0 and 0.35 then '0.25 Ton'
when column1*Column2*Column3/1000000000*2.5*to_number(substr(Column4,2,3)) between 0.351 and 0.85 then '0.5 Ton'
when column1*Column2*Column3/1000000000*2.5*to_number(substr(Column4,2,3)) between  between 0.851 and 1.35 then '1 Ton'
when column1*Column2*Column3/1000000000*2.5*to_number(substr(Column4,2,3)) between  between 1.351 and 2.25 then '2.0 Tons'
when column1*Column2*Column3/1000000000*2.5*to_number(substr(Column4,2,3)) between  > 2.25 then '2.5 Tons'
end

this query is working fine in oracle, but when i use this statement in calculated field it was showing as "Cannot evaluate expression"

Where i am making the mistake or how to make this above statement possible in Jaspersoft?

Kindly guide me...

Thanks in Advance,

Robert J

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Case statement is not supported in i-report

You can try this

column1*Column2*Column3/1000000000*2.5*to_number(substr(Column4,2,3)) >= 0 && column1*Column2*Column3/1000000000*2.5*to_number(substr(Column4,2,3))<=0.35 ? '0.25 Ton' :

column1*Column2*Column3/1000000000*2.5*to_number(substr(Column4,2,3)) >= 0.351 && column1*Column2*Column3/1000000000*2.5*to_number(substr(Column4,2,3))<= 0.85 ? '0.5 Ton' :

column1*Column2*Column3/1000000000*2.5*to_number(substr(Column4,2,3)) >=  0.851 && column1*Column2*Column3/1000000000*2.5*to_number(substr(Column4,2,3))<= 1.35 ? '1 Ton' :

column1*Column2*Column3/1000000000*2.5*to_number(substr(Column4,2,3)) >=  between 1.351 && column1*Column2*Column3/1000000000*2.5*to_number(substr(Column4,2,3)) <=2.25 ? '2.0 Tons' :

column1*Column2*Column3/1000000000*2.5*to_number(substr(Column4,2,3))   > 2.25? '2.5 Tons' : "Unknown"

 

Hope this help

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...