Select to view content in your preferred language

Calculation of sum

286
7
Jump to solution
a month ago
DrJumaKhudonazarov
Frequent Contributor
 
score22
score33
score22
score1010
score1111
coalesce(${q1},0)+coalesce(${q2},0)+coalesce(${q3},0)+coalesce(${q4},0)+coalesce(${q5},0)

 

I need a formula that automatically calculates the sum on the above table and tells me the service needed or No can someone help. I have tried to use above  calculation but didn't work

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Chris_976
Occasional Contributor

Okay, then you just need to add a select_one question with choices set as 'service_required', 'no_service_needed', set "read only" attribute to 'yes' and use the "calculation" attribute if(${sum}<10, 'service_required', 'no_service_needed').

Chris_976_0-1744612141428.png

Chris_976_1-1744612147762.png

That will calculate automatically the status based on the sum above.

- - -
Christophe AGNES
GIS Head @ Mayotte's public institution for land and country planning

View solution in original post

7 Replies
LaurenceTait
Frequent Contributor

Are you trying to do this in a report, or within a survey, or somewhere else? Where did this table come from?

DrJumaKhudonazarov
Frequent Contributor

with connect  ,  report  survey 123 advanced form 

0 Kudos
LaurenceTait
Frequent Contributor

If you are asking for our assistance, it would be polite if you provide comprehensive, repsonsive answers, rather than unpunctuated and abbreviate, irrelevant single lines responses. 

We can't help you if you refuse to provide necessary information, and you may find that some people won't help you even if they can.

So I will try once again:

Are you trying to do this in a report, or within a survey, or somewhere else? Where did this table come from?

0 Kudos
Chris_976
Occasional Contributor

Hello. Based on what I understand of your question, I created a choice list named 'score' and used it in 4 select_one questions as shown below.

Capture d'écran 2025-04-11 092322.png

 The formula then works just fine :

Chris_976_0-1744352649987.png

 

Hope it can helps !

Cheers

- - -
Christophe AGNES
GIS Head @ Mayotte's public institution for land and country planning
0 Kudos
DrJumaKhudonazarov
Frequent Contributor

Dear Christophe AGNES,

 

Thanks indeed helpful. I just don't want to  sum  but also create relationship if  score less than 10  service required if more than 10  No  service  needed 

0 Kudos
Chris_976
Occasional Contributor

Okay, then you just need to add a select_one question with choices set as 'service_required', 'no_service_needed', set "read only" attribute to 'yes' and use the "calculation" attribute if(${sum}<10, 'service_required', 'no_service_needed').

Chris_976_0-1744612141428.png

Chris_976_1-1744612147762.png

That will calculate automatically the status based on the sum above.

- - -
Christophe AGNES
GIS Head @ Mayotte's public institution for land and country planning
DrJumaKhudonazarov
Frequent Contributor

that is great  thank you very much  sorted out now

0 Kudos