Calculations with IF

How do integrate an IF statement into a Kobotoolbox calculate? This is what I'm trying to achieve: We provide agriculture insurance to farmers in Uganda and farmers get a subsidy depending on how much they earn per season. If a farmer's expected seasonal yield which is also called sum insured is below 20,000,000/= Uganda Shillings (about $6,000), they get a 50% subsidy. If they earn more than 20,000,000/= they get a 30% subsidy. Premium is 5% of the expected yield

1 Like

You should be able to use an if statement like this: if(${yield}<20000000, ${yield}*50/100, ${yield}*30/100). It might also work to calculate both values and just display one as read_only answer, using “relevant”.

I haven’t tried either solution but check the thread below:

https://forum.opendatakit.org/t/how-to-use-if-else-in-xls-forms/4360/2

Best Regards,

Jesaja Everling

···

On Tue, Jan 30, 2018 at 7:22 PM, Ninsiima Daniel dnin...@gmail.com wrote:

How do integrate an IF statement into a Kobotoolbox calculate? This is what I’m trying to achieve: We provide agriculture insurance to farmers in Uganda and farmers get a subsidy depending on how much they earn per season. If a farmer’s expected seasonal yield which is also called sum insured is below 20,000,000/= Uganda Shillings (about $6,000), they get a 50% subsidy. If they earn more than 20,000,000/= they get a 30% subsidy. Premium is 5% of the expected yield

–

You received this message because you are subscribed to the Google Groups “KoBoToolbox Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to kobo-users+unsubscribe@googlegroups.com.

To post to this group, send email to kobo-...@googlegroups.com.

Visit this group at https://groups.google.com/group/kobo-users.

For more options, visit https://groups.google.com/d/optout.

1 Like

Thank you for the quick response. It worked like a charm.