Coalesce is resulting in 0

Hi sir,

May I ask for help in solving my issue on coalesce. I have used the formula you have shared in the forum: coalesce(${Total},0)+coalesce(${Total_outside},0)+coalesce(${Total_one_within},0)+coalesce(${Total_one_outside},0), however, the result I have is 0 (ZERO). This should not be the cased as the scores being coalesced are ranging from 1-2. Here’s the link to the file: G-ESG Rapid Assessment Tool | KoboToolbox (humanitarianresponse.info).

Welcome to the community, @Derek1! This post discussed previously should help you understand more about using coalesce:

1 Like

Hello sir,

Appreciate very much your help but tried the formula and nothing appeared on the form. Can you please help me further?


Here’s the file in Kobo: G-ESG Rapid Assessment Tool | KoboToolbox (humanitarianresponse.info). I do not have administration permission to upload the XLS file.

Thank you!
Derek!

Hi @Derek1,

In the first image Kal shared, there is a note type question, that question allows you to see the result of the calculation.

That’s because the calculate type questions are not visible to the enumarators (the ones who are filling the form).

If you want to display the result of the calculation you also need to add a note type question.

Hope this helps.
If you need further help, don’t hesitate to ask.

1 Like

Hi Hakan,

Sorry, I forgot to add a note type question. Another problem I have is how to reflect the level of capacity with the score that an organization has. What formula to use?

Thank you!

I used this: if((${_Total_GE} <= 3), “Gendered Environmental Unaware”, if((${_Total_GE} >= 4 and ${_Total_GE} <= 6), but not working.

Hi sir Kal,

Can you please help me on using If function? I wanted to have a formula that give me the level of capacity when the score is within the range of If formula. Example: if((${_Total_GE} <= 3), “Gendered Environmental Unaware”, if((${_Total_GE} >= 4 and ${_Total_GE} <= 6), “Gendered Environmental Aware”, if((${_Total_GE} >= 7 and ${_Total_GE} <= 9), “Gendered Environmental Responsive”, if((${_Total_GE} >= 10 and ${_Total_GE} <= 12), “Gendered Environmental Transformative”)))). However, my formula is not working.

Many thanks!

Hi @Derek1,

I didn’t look at the potential syntax and paranthesis problems:

if((${_Total_GE} <= 3), “Gendered Environmental Unaware”, if((${_Total_GE} >= 4 and ${_Total_GE} <= 6), “Gendered Environmental Aware”, if((${_Total_GE} >= 7 and ${_Total_GE} <= 9), “Gendered Environmental Responsive”, if((${_Total_GE} >= 10 and ${_Total_GE} <= 12), “Gendered Environmental Transformative”))))

It seems like the last if statement needs an ELSE statement:

IF(THEN, ELSE)

Right now your IF statement is like this:

IF(THEN, IF(THEN, IF(THEN)))

1 Like

Hi sir,

Figured out now with this formula: if((${Total_GE} <= 3), “Gendered Environmental Unaware”, if((${Total_GE} >= 4 and ${Total_GE} <= 6), “Gendered Environmental Aware”, if((${Total_GE} >= 7 and ${Total_GE} <= 9), “Gendered Environmental Responsive”, if((${Total_GE} >= 10 and ${Total_GE} <= 12), “Gendered Environmental Transformative”)))). Thank God, now working!

2 Likes

@Derek1, @hakan_cetinkaya :clap: :heart: :partying_face:

1 Like

Hi Sir,

May I ask for your assistance in resolving an issue in the app? When I was already using the app an error occurred in the process: " Error evaluating field ‘_Total_GE_R’ (…)… Xpath evaluation cannot handle function ‘if’ requires 3 arguments. Only 2 provided.
This issue however did not happen in the web browser.

Thank you!

Hi @Derek1, can you post this issue as another post, and provide screenshots of the problem?

1 Like