solene.masseron Posted February 8, 2023 Share Posted February 8, 2023 Hello everyone,If I may, I would like to ask you because I would like to count the active or non-active numbers. This data is characterised by the number of Yes and No per municipality. I created a common group and a variable to compatbilise.I set the variable as follows:calculation: sumexpression:IF($F{arret_dorm}=="Oui",1,0)initial value expression:$F{arret_dorm}.getValue.parseInt(Oui,1)the problem is that the entire transformation is not happening and I don’t know how else to do it.HELP Link to comment Share on other sites More sharing options...
johannes.held Posted February 14, 2023 Share Posted February 14, 2023 Hello,This should actually work as a problem. Your idea behind it is correct:Depending on the value of the string (yes or no) a 1 or 0 is summed up. This gives the total sum of the records with yes.I would simply set the Initial Expression to 1. This will be overwritten with the first record anyway.I would set the Expression to$F{arret_dom} != null && $F{arret_dom}.exqualsIgnoreCase("oui") ? 1 : 0Probably your comparison with == leads to a problem. This checks the equality of objects in Java. Two strings can have the same content but be different objects.Consider also the correct evaluation time of the text field in which you use this variable.Greetings, Johannes Link to comment Share on other sites More sharing options...
solene.masseron Posted March 2, 2023 Author Share Posted March 2, 2023 Good morning,I apologize for my late response time I tested your solution. Attached is the picture of the parameters . I have a problem with my initial text field because I want to convert text to whole .I can’t convert this field to a whole.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