Exclude choice from calculate function

Hi everyone. I have a form in which there is a repeat group in which enumerators keep entering receipt data for a particular customer. Once a customer’s receipts are entered, their total amount is calculated. However, I want to exclude from that calculation certain brands, and instead use that data in a different place.
For example there are 3 receipts for 3 different Stores. Store A Receipt is for $5, B is for $6, C is for $10.
I am calculating the total amount as sum(${Receipt_Amount}) but I want to exclude Store B from the calculation. I tried: if(${Stores}!=‘Store B’, sum(${Receipt_Amount}),0), but its not working.

Please help!

@eeshatariq, could you list out the possible questions so that we too could visualize your requirement? Note: please try to list out only 3-4 questions that are needed for the dummy workaround. Also please try to describe what should be excluded from the calculation.

Sure. So here are a few questions:

Name:
Age:

Repeat Group Start:

Receipt No.:
Store:

  • A
  • B
  • C
  • D
  • E

Receipt Amount:
Receipt Date:
Receipt Time:

Repeat Group End

Total Amount: $___
Total Amount from Store B: $___

I want to exclude Store B from the calculation of the Total Amount, and instead use it in Total Amount from Store B

@eeshatariq, is the store fixed or is it something that you would not know when designing your survey project?

It is fixed, I have the specific names

1 Like

Hi @eeshatariq
Could you send the XLS version of the questionnaire that you had originally developed?

Stephane

1 Like

Hi @eeshatariq ,
Could you please have a look at this file, it could solve your issue.
Test.xlsx (10.3 KB)
Best,

Yasser

1 Like