How to sum a group of sub items?

Hello Memebers,

Thank-you for creating tool like Kobo. It helped easy my survey tool I m building,

I have the following question on Kobo which has sub-items, each item has (Yes,No,N/A) choice. The main question is the group containing all its sub-items.
Then , there is a total score to be calculated using the following assumption/condition:

Hi @DanielEth,

Welcome to the community! At the moment you will need to do the calculations manually under the calculation column by setting some rule. At the moment i see 13 sub items. Is this all that you have that requires a calculation or is there more sub items? Maybe the community could show you how the calculation looks like (if you are OK to learn the notion).

Besides, would you also clarify the following so that the community could come up with a precise solution to your issue:

If an sub item is selected Yes does it carry a value of 1? And do you wish to calculate the total of the score that has been selected?

Have a great day!

Hi @DanielEth,

Sorry for making this query again. But could you please list out all the sub items and then provide the score for the choices e.g.

Occurrence log sheet
Yes (… points)
N/A (… points)
No (… points)

Microscope preventive maintenance form
Yes (… points)
N/A (… points)
No (… points)

and so on …

This is because, being clear on what you require the community could provide you with a precise response.

Have a great day!

Hi @DanielEth,

Maybe this is what you were seeking.

In the survey tab of your xlsform:

In the choices tab of your xlsform:

Image 2

Data entry screen as seen in Enketo:

Reference xlsform:

Sum 2020 08 12.xlsx (12.0 KB)

Have a great day!

Is this possible to do in Kobo ? Assigment like count =count + 1

if((${Q1_4}=β€˜1’),${count_y}=${count_y}+1,if((${Q1_4}=β€˜2’),${count_n}=${count_n}+1,if((${Q1_4}=β€˜3’),${count_na}=${count_na}+1,β€˜0’)))

Hi @DanielEth
I am glad to know that the workaround suggested by @Kal_Lam actually worked on your end.

On your second issue below

It is definitely possible to do this but you need to write your formula appropriately. As it is, I am still finding it difficult to figure your logic on this, maybe some more information will help me better support you to get this done.

Stephane

1 Like

Hi
A quick check shows that your form has a different issue

Could you first sort it out by solving the issue based on the discussions that happened here

1 Like

Hi,
Kindly check the topic, this is definately an error on the form and we have experienced it before and solved it within the topic I shared. Kindly have a look at it.

Stephane

1 Like

Hi,
Unfortunately we have to limit the conversations here since this is a very form specific issue and not a system related issue.

I would give an explanation of the logic so that you try it out, you can check all the Yes summation and No summation using an example logic below.

Number of Yeses
((if(${Q1_2a}=β€œYes”,1,0))+(if(${Q1_2b}=β€œYes”,1,0))+(if(${Q1_2c}=β€œYes”,1,0))+(if(${Q1_2d}=β€œYes”,1,0))

Stephane

2 Likes

This the solution i needed with lots of trail and calculation variables. Take a look ?

Done to small part, now its matter of duplication :slight_smile:

Cheers! @Kal_Lam @stephanealoo

2 Likes

Hello,
Would you mind to share the solution code here too?

2 Likes