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 "
Kindly guide me...
Thanks in Advance,
Robert J
1 Answer:
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
Hi Hishamkmr,
I have tried with the above answer but i have encountered the following error "Found '&&' after end of expression"
Any other Suggestions...
Thanks in Advance,
Robert J
Hi Robert,
can you copy + paste the code you tried? is it the same code?
Hi Hishamkmr,
i have copy paste the same code and i have changed the column names and i have tried the error occurs and i have cleared the blank spaces and tried but the same result...
Any other views...