solene.masseron Posted March 20, 2023 Share Posted March 20, 2023 Hello everyoneI’m a little desperate. I try to sum up the number of yes and no that there is in my transport stop table that is in database and I do not understand what is wrong with it.I created a variable configured this way:name value class: java.lang.integercalculation: sumexpression:IF($F{arret_dorm} ="Non",1,0)intimate value expression: 0increment type: nonetype réinitialisatio common groupand then I put this variable in the header detail, knowing that I have a band.The problem is that it always appears 0 as a value. If I set 1 to the initial value, it remains 0.I’m not sure what to do any help will be welcome Link to comment Share on other sites More sharing options...
Jivan Phadtare Posted March 20, 2023 Share Posted March 20, 2023 Hello,You can try using compareTo() function this function accepts string and if it matches to provided string then it will return 0.so you can try using expression something like below and set true value as 1.IF($F{arret_dorm}.compareTo( "Yes")==0,1,0)Hopefully this will help you. Link to comment Share on other sites More sharing options...
solene.masseron Posted March 22, 2023 Author Share Posted March 22, 2023 Hello , Thank you for your answer, but he does not calculate the sum of the values. He does a count. Knowing that in the variable in the calculation tab there is sum.Thank you for your help 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