Coalesce function is not working

hello @Kal_Lam, I am working in two project, the first one is the parent form and is an enrollment form which collects information about the participants who will be part of a program.
The child form is an attendance sheet that reports the number of participants in a community. in the child form, at the end I have generated variables to add up the number of female and male participants, for this I have used the functions:

coalesce(${Sexo_G1_mujer}, 0)+ coalesce(${Sexo_G2_mujer}, 0)+coalesce(${Sexo_G3_mujer}, 0)+ coalesce(${Sexo_G4_mujer}, 0)+ coalesce(${Sexo_G5_mujer}, 0)
coalesce(${Sexo_G1_hombre}, 0)+ coalesce(${Sexo_G2_hombre}, 0)+ coalesce(${Sexo_G3_hombre}, 0)+ coalesce(${Sexo_G4_hombre}, 0)+ coalesce(${Sexo_G5_hombre}, 0)
${mujeres_talleres}+${hombres_talleres}

when tested, it does work well for women, however, it does not generate information about the male participants. I have checked, and I don’t know what could be wrong.

I would appreciate your help.
I share with you the forms
Parent form:
FORMULARIO PADRE INSCRIPCION.xlsx (26.3 KB)

child form
FICHA REGISTRO CAPACITACIONES, TALLERES U OTRAS ACTIVIDADES.xlsx (27.5 KB)

If you need access, please let me know.

I will appreciate if any one of the @ambassadors can support, will be great.

Greetings!

Hi @raquelchaicoj, were you able to solve your problem? because i checked your form and it looks like working fine.


1 Like

Hello Osman, I try once but still not working

if it is need it, I can share permission to the project forms. or we can have some zoom meeting.

Thank you very much for your time

if you can share the both form with username osmanislamburcu , i can can test

1 Like

Could you try to strip down the form to a short example, still reproducing your error.
I tried a minimal extract with manual entry. It seems to show that the coalesce and it’s input calculations are not the problem.
wroExtract01_FICHA_REGISTRO.xlsx (10.9 KB)

Side-note: Select-values are always stored as strings, so better use if(${Sexo_G4} = ‘1’, 1, 0). And better avoid blanks and special characters in file names.

Hello again dear colleagues, I am still having problems with the function of being able to add the registered participants by gender.
The form can collect information from different actors or participants, for example: 1: teachers, group 2: children, group 3: adolescents.
For each participant you must enter the participants, for this I have created groups that can be repeated “n” number of times according to the needs of the moment. In each group data is collected, including the sex of the participant.
At the end I need to add the participants by sex, of all the groups that have been registered.
The problem that exists is that it only takes into account the first registered participant, that is to say, if you select the first group, it only adds up to the first registration and does not count the subsequent registrations.

I have checked if the expressions are ok, but I can’t find why it doesn’t add up correctly. could you check the XLS? I have marked with colors the variables that should add up so you can easily identify them.
FICHA REGISTRO CAPACITACIONES, TALLERES U OTRAS ACTIVIDADESv3.xlsx (29.1 KB)

Hope you can help me.

Thank you in advance

Hello Osman, I already add you to the project:


If you have time, I will appreciate your support.

Thank you very much.

Hello wroos, I have reduced the form, leaving the variables that I need for the addition, to make the review easier.
TEST_SUM_GROUPS.xlsx (24.6 KB)