robert.j Posted October 7, 2013 Share Posted October 7, 2013 Dear All,I am trying to create a domain calculated field that has case statement, i am trying the below statement for the calculated fieldcasewhen 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'endthis 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 More sharing options...
hishamkmr Posted October 7, 2013 Share Posted October 7, 2013 Case statement is not supported in i-reportYou can try thiscolumn1*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 More sharing options...
robert.j Posted October 7, 2013 Author Share Posted October 7, 2013 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 Link to comment Share on other sites More sharing options...
hishamkmr Posted October 7, 2013 Share Posted October 7, 2013 Hi Robert, can you copy + paste the code you tried? is it the same code? Link to comment Share on other sites More sharing options...
robert.j Posted October 8, 2013 Author Share Posted October 8, 2013 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... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now