Calculation

I have 3 fields- weekly earning, cash in hand and weekly expenditure. i
have a hidden field to determine Total Savings. Can anyone help me as how
to set the Calculation in Display condition? To the best of my knowledge:
Total Savings:(weekly earning + cash in hand) - (weekly expenditure).
This is waht i have done, but it doesn't seem to be working.

Hi Sallieu,

In a hidden value, the calculation you want to perform should go in the
"Calculate Condition" box, not in the "Display Condition" box. Is that
where you've put your calculation?

Best,
Kriti

··· On Tue, Dec 29, 2015 at 10:23 AM, Sallieu Dumbuya <sallieu.dumbuya@gmail.com wrote:

I have 3 fields- weekly earning, cash in hand and weekly expenditure. i
have a hidden field to determine Total Savings. Can anyone help me as how
to set the Calculation in Display condition? To the best of my knowledge:
Total Savings:(weekly earning + cash in hand) - (weekly expenditure).
This is waht i have done, but it doesn't seem to be working.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yes, that is exactly where I placed my calculation. I will just show how
the syntax I typed: int((/data/Income_tracking/Average_Weekly_Income) +
/data/Income_tracking/Caregiver_Cash_in_Hand)
-(/data/Income_tracking/Average_Weekly_Expenditure)

··· On Tuesday, 29 December 2015 15:23:02 UTC, Sallieu Dumbuya wrote: > > I have 3 fields- weekly earning, cash in hand and weekly expenditure. i > have a hidden field to determine Total Savings. Can anyone help me as how > to set the Calculation in Display condition? To the best of my knowledge: > Total Savings:(weekly earning + cash in hand) - (weekly expenditure). > This is waht i have done, but it doesn't seem to be working. >

the 3 relevant questions are:

  1. Total average weekly income.
  2. total average weekly expenditure.
  3. Cash in hand.
    these are 3 questions that should be part of the calculation. the answer
    needed is Total Savings.
··· On Tuesday, 29 December 2015 15:23:02 UTC, Sallieu Dumbuya wrote: > > I have 3 fields- weekly earning, cash in hand and weekly expenditure. i > have a hidden field to determine Total Savings. Can anyone help me as how > to set the Calculation in Display condition? To the best of my knowledge: > Total Savings:(weekly earning + cash in hand) - (weekly expenditure). > This is waht i have done, but it doesn't seem to be working. >

They are all integer questions,

··· On Tuesday, 29 December 2015 15:23:02 UTC, Sallieu Dumbuya wrote: > > I have 3 fields- weekly earning, cash in hand and weekly expenditure. i > have a hidden field to determine Total Savings. Can anyone help me as how > to set the Calculation in Display condition? To the best of my knowledge: > Total Savings:(weekly earning + cash in hand) - (weekly expenditure). > This is waht i have done, but it doesn't seem to be working. >

Hi again,

What question types are the 3 relevant questions
(/data/Income_tracking/Average_Weekly_Income,
/data/Income_tracking/Caregiver_Cash_in_Hand and
/data/Income_tracking/Average_Weekly_Expenditure)?

Best,
Kriti

··· On Wed, Dec 30, 2015 at 4:28 AM, Sallieu Dumbuya wrote:

Yes, that is exactly where I placed my calculation. I will just show how
the syntax I typed: int((/data/Income_tracking/Average_Weekly_Income) +
/data/Income_tracking/Caregiver_Cash_in_Hand)
-(/data/Income_tracking/Average_Weekly_Expenditure)

On Tuesday, 29 December 2015 15:23:02 UTC, Sallieu Dumbuya wrote:

I have 3 fields- weekly earning, cash in hand and weekly expenditure. i
have a hidden field to determine Total Savings. Can anyone help me as how
to set the Calculation in Display condition? To the best of my knowledge:
Total Savings:(weekly earning + cash in hand) - (weekly expenditure).
This is waht i have done, but it doesn't seem to be working.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Sallieu,

Sorry, I wasn't clear in my question! I meant to ask what question type are
those 3 values? Are they integer questions, decimal questions, hidden
values etc.?

Best,
Kriti

··· On Wed, Dec 30, 2015 at 9:13 AM, Sallieu Dumbuya wrote:

the 3 relevant questions are:

  1. Total average weekly income.
  2. total average weekly expenditure.
  3. Cash in hand.
    these are 3 questions that should be part of the calculation. the answer
    needed is Total Savings.

On Tuesday, 29 December 2015 15:23:02 UTC, Sallieu Dumbuya wrote:

I have 3 fields- weekly earning, cash in hand and weekly expenditure. i
have a hidden field to determine Total Savings. Can anyone help me as how
to set the Calculation in Display condition? To the best of my knowledge:
Total Savings:(weekly earning + cash in hand) - (weekly expenditure).
This is waht i have done, but it doesn't seem to be working.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Sallieu,

Your calculation looks right to me! (Note that if they are all integer
questions, you shouldn't need to use the "int()" function - though it can't
hurt either).

Can you describe the error message or other unexpected behavior you are
seeing?

Thanks,
Amelia

··· On Thu, Dec 31, 2015 at 5:19 AM, Sallieu Dumbuya wrote:

They are all integer questions,

On Tuesday, 29 December 2015 15:23:02 UTC, Sallieu Dumbuya wrote:

I have 3 fields- weekly earning, cash in hand and weekly expenditure. i
have a hidden field to determine Total Savings. Can anyone help me as how
to set the Calculation in Display condition? To the best of my knowledge:
Total Savings:(weekly earning + cash in hand) - (weekly expenditure).
This is waht i have done, but it doesn't seem to be working.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.