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: sum
expression: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
2 Answers:
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 : 0
Probably 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
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 =)
Attachment | Size |
---|---|
![]() | 239.77 KB |