rathi Posted September 8, 2016 Share Posted September 8, 2016 Hi,I have a query asSelectattribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,attribute9, attribute10From farmer dfwhere df.CompanyId =$P{company_id}and 1= (case when $P{current_history} = 'Active' and df.partitionflag = 1 then 1when $P{current_history} = 'Inactive' and df.partitionflag = 0 then 1else 0end) The case part in the 'where' clause isn't working. Any help on understanding how to solve this would be greatly appreciated ThanksRathi Link to comment Share on other sites More sharing options...
dimiturtabakov Posted September 9, 2016 Share Posted September 9, 2016 "and 1=(casewhen $P{current_history} = 'Active' and df.partitionflag = 1 then 1when $P{current_history} = 'Inactive' and df.partitionflag = 0 then 1else 0end)" I'm not sure that's the way to do what you're trying to. Try this instead:"...and case when $P{current_history} = 'Active' and df.partitionflag = 1 then 1=1 when $P{current_history} = 'Inactive' and df.partitionflag = 0 then 1=1 else 1=0 end " Link to comment Share on other sites More sharing options...
rathi Posted September 9, 2016 Author Share Posted September 9, 2016 Thank you will try this :) Link to comment Share on other sites More sharing options...
rathi Posted September 13, 2016 Author Share Posted September 13, 2016 Hi , The suggested case expression is not working.Does jasper not support case?ThanksRathi Link to comment Share on other sites More sharing options...
Solution rathi Posted September 14, 2016 Author Solution Share Posted September 14, 2016 Hi,Its working now. Its just that the case statement must not be surrounded by brackets.... and 1= (case when .... then ... end) does not workbut ... and 1 = case when.., then ... end worksThanksRathi 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