schaibaa Posted January 16, 2007 Share Posted January 16, 2007 Hello, I recently purchased your documentation. I'm trying to solve a problem with evaluation times when adding items and was hoping it would help, but I was hoping you might have some more advice. I have a field that comes in as degree_type, and I have a few variables that count to see how many of each degree type come through the query. These are grouped hierarchical, by something like the city that these people live in. Coming from my query is something like: City1|mastersCity1|mastersCity1|mastersCity1|mastersCity1|BachelorsCity1|BachelorsCity1|BachelorsCity1|BachelorsCity1|BachelorsCity1|BachelorsCity1|DoctorateCity1|DoctorateCity1|DoctorateCity1|Doctorate What I want displayed is:City | Masters | Doctorate | Bachelors |City1 | 4 | 4 | 6 | These are coming through perfectly and grouping by City. When I make a variable that adds the three, I cannot get the calculation to return the correct value. My variable expression is:new Integer($V{masters_count}.intValue() + $V{doctorate_count}.intValue() + $V{postdoc_count}.intValue()) My reset type is group: city, and the evaluation time of my text field is group: city. When I run the report, 0 is returned. If I run the report and just change my expression to: new String($V{masters_count}.toString() + $V{doctorate_count}.toString() + $V{postdoc_count}.toString()) I do get the expected results. Please assist! Thanks in advance Link to comment Share on other sites More sharing options...
schaibaa Posted January 17, 2007 Author Share Posted January 17, 2007 It appears that you cannot calculate this way because these expresions are attempting to calculate simultaneously, therefore you cannot piggy-back expressions in the same band. The alternative was to re-evaluate these in one varialbe, for example A count variable, reset type is group:city Expression:$F{degree_name}.startsWith( "Master" ) || $F{degree_name}.startsWith( "Ph.D" ) ? "count me" : null etc etc Goodluck! 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