Perform calculation on Text

(Sallieu Dumbuya) #1

I have a field for Male & Female. _I have have a hidden value that calculate total male and total female separately.
Say Hidden vale- Total male & Total female.
appreciate if i can get any prompt help.
thanks to anyone who can help with this.

(Clayton Sims) #2

Hi Sallieu,

To clarify your question: Are you trying to have a hidden value that sums a total differently based on a field that asks whether a person is male or female?

I believe you can use a normal ‘if’ expression to accomplish that, like

total = if( #form/sex = ‘m’, ( CALCULATION_FOR_MALE), (CALCULATION_FOR_FEMALE) )

If I misunderstood your query, can you please clarify what you are trying to accomplish?


(Sallieu Dumbuya) #3

Thanks for the support. you interpreted the question correctly. Yes i want to calculate total male or female based on the answer selected for Sex (either m or f).
But i seem to receive an error message when i tried to create a new version. i will send a screenshot of both:

the screenshot for the form itself:
waiting for further support. Thanks.

(Sallieu Dumbuya) #4

The screenshot for the form itself

(Mazen AlAli) #5


Take a look at this page here

Under “Logic outside of a repeat group” section you should find the answer to your problem

basically, outside the repeat, have a hidden value that sums up the number of repeats where the filter looks like [sex = “m”] and another hidden value that does the same, but the filter saying [sex=“f”]



(Clayton Sims) #6


It looks like you’ve copied over the exact calculate expression. Apologies for my lack of clarity: that expression is for example, but you’ll need to, say, update the relevant portions which are specific to your form (like the location of the ‘sex’ question and the calculations for the male and female score) for the expression to work.