Income calculation inside a repeat group

Good day!

I created a questionnaire to calculate household income specified to each household member who generate income through employment and other form of income generation. I have no idea how to calculate. I am not able to upload my xls form. How can I post my questionnaire for reference?a5HddwojcxxJYBWpEJDjnJ.xlsx (7.4 KB)

Welcome to the community, @EWPD1! You should now be able to upload your xlsform. If you still are not able, please refresh your page.

I have already uploaded my xlsform Sir, kindly review. Thanks

@EWPD1, we have some workarounds (on how to calculate a sum from within a repeat group) which should be helpful for you:

Another one:

And this one:

Here too:

Last but not the least:

@Kal_Lam this form was made through form builder. Thank you for the references, it helps to my current and future projects better representation. But my problem is, I don’t know the formula to calculate the values. Does “If” command will applicable?

You don’t need to use an if-statement unless you really need to use them. This will help you be specific with what you wish to capture from the repeat group. If you don’t want to be specific you could simply avoid using it.

In my case, I want to sum all of the values that will be gather during the interview. For example, if household head and spouse were employed then their son and daughter were not employed but they have other source of income. Or the other way around.

Seems like you wish to be specific. In this case, you will need to use the if-statement as shown in the workarounds shared above.

@Kal_Lam I only need to calculate the income in reference to my uploaded form. I need to calculate the total income provided by household members. So, I will not calculate manually and put values.

Have you gone through the workarounds that I shared? It has all the reference xlsform that you should require for your issue. Try uploading them to your account and make some dummy entries. You will then understand how the same works.

@Kal_Lam my concern is not solved by the reference xlsform that you have shared, but it can be my reference for other projects. My concern is to sum the value of income earned/receive by household member. Should I use ‘sum’ or ‘+’ to add the values?. I am new user of Kobo

Hi,
You should use either the sum or coalesce value as discussed within our support articles

Stephane

1 Like

Good Day @stephanealoo,

This might help, but I can’t figure out how should I do it on my project. If you have time kindly review my attached xlsfrom. Thank you

Hi @Kal_Lam I can’t still figure out what calculation I will input.

@EWPD1, OK will have a look at it and then get back to you.

@Kal_Lam sorry I am new to Kobo

1 Like

@EWPD1, you could do the same as outlined in the image shared below:

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:

Repeat Group.xlsx (12.5 KB)

1 Like

@Kal_Lam This helps a lot Sir. Thank you so much…
Commendable for immediate response and expertise.

1 Like

Good Day Sir,

May I know if(${Q4} !=’’,${Q4},‘0’) when I use the if statement?Kindly teach me what is the meaning of that calculation?

This is an if-statement that will take the value that was recorded in Q4 if it’s not empty else it will take the value 0 if it’s empty.