Jason30 Posted April 21, 2017 Share Posted April 21, 2017 Hi all,I wonder how to count different values.Example output of the table in the group band:Row 1:Cat 1: 4Cat 2: 3Cat 3: 3Row 2:Cat 1: 1Cat 2: 2Cat 3: 1Then I want to put the total in the last page footer: 14Note: There could alse be 3 rows, or 4.Thanks in advance for any help / insights. Link to comment Share on other sites More sharing options...
joseng62 Posted April 24, 2017 Share Posted April 24, 2017 You need to be more specific and clear on this. Is the value "1. Cat 1:1" the whole value a string or are they broken up in 4 columns. At end of day you would need to create a variable and use the calculation function to count of sum. Then depending on how you want to count or sum, you need to create group and use the correct bands. Then you need to select the increment type and Reset type. Can also create multiple variables with different groupings, increment types and Reset types and then count sum these together. If you want to use the last value in your "1. Cat 1:1" value, you can use subring methods to get last value and then convert the value to integer and then count or sum. One can also create REgex jar custom, so you can use a regex methods to get the required value, then convert type, then count or sum.Many ways, it just depends on how you want to do it. Link to comment Share on other sites More sharing options...
Jason30 Posted April 26, 2017 Author Share Posted April 26, 2017 Thanks for your reaction Joseng.Sorry for the indistinctness.The value is a calculated field.So in the example there are 6 values (3 in row 1 + 3 in row 2)On the end I want to sum all 6 calculated values.I am new to Jaspersoft, but coding wise I try to achieve something like this:In the group (hidden?):$variable1 = 4$variable2 = 3$variable3 = 3$variable4 = 1$variable5 = 2$variable6 = 1Page footer contains:$total = $variable1+$variable2+$variable3+$variable4+$variable5+$variable6;Hopefully this makes it more clearly.Thanks again. 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