FormLogicError: Could not evaluate: if( /model/instance[1]/data/group_ll9ke29/AHIV =’‘0’’,’‘0’’,if( /model/instance[1]/data/group_ll9ke29/AHIV =’‘1’’,’‘0’’,if( /model/instance[1]/data/group_ll9ke29/AHIV =’‘2’’,’‘5’’,if( /model/instance[1]/data/group_ll9ke29/AHIV =’‘3’’,‘10’if( /model/instance[1]/data/group_ll9ke29/AHIV =’‘4’’,’‘15’’,’ ‘))), message: Weird args (should be separated by commas):[{“t”:“bool”,“v”:true},{“t”:“num”,“str”:“4”,“v”:4},{“t”:“str”,“quote”:"’",“v”:""},",",{“t”:“str”,“quote”:"’",“v”:""},{“t”:“num”,“str”:“15”,“v”:15},{“t”:“str”,“quote”:"’",“v”:""},",",{“t”:“str”,“quote”:"’",“v”:" "}]
This is my question below:
(INDICATE THE APPROPRIATE RESPONSE BETWEEN 0 AND 4 FOR EACH SERVICE)
0=Do not provide service
1= Less than 500 client visits
2= Up to 500 client visits
3= 501 – 2000 client visits
4= 2000+ client visits
A. HIV testing ……………………[ ]
B. ART…………………………….[ ]
C. Voluntary Male Circumcision……………….….[ ]
D. Cervical Cancer Screening ….[ ]
E. Family Planning………………[ ]
F. HIV Pre-Exposure Prophylaxis (PrEP) …………………………[ ]
G. Antenatal services……….…. [ ]
H. Labor and Delivery Services…[ ]
I. Childhood immunizations and growth monitoring……………[ ]
J. other ___________________[ ]
(Specify)
How do I go about the calculation to make a score?
Can you provide a screenshot of the calculation column you are using? I think you are giving scores with if statements and something is not right with the statement.
Notice there are no quotation marks ( " ) in the statement. There is only Apostrophe ( ' ) for specifying the choice of your question.
I think you are using these scores you created with if to calculate a decimal equation.
So trying to write your statements like this should solve your issue:
if(${AHIV}= ‘0’, 0, if(${AHIV}= ‘1’, 0, if(${AHIV}= ‘2’, 5, if(${AHIV}= ‘3’, 10, 15)))) Notice that, i skipped last if statement because there is no other answer can be given On second look I saw you didn’t make this question mandatory so above statement should be re-written for the blank questions
Feel free to ask if you need further help, hope this helps.
Best,
@hakan_cetinkaya
Thanks a lot I much appreciate. This is very helpful and it has worked, I struggled the whole morning.
Just for my learning purposes, for option number 4, no need of highlighting it as: (${AHIV}= 4’, 15?
I make the 15 as an else option, as in if nothing prior to that has been selected, but i saw you didn’t make the question mandatory, meaning someone might skip an answer to that question, if so you should consider giving a score for blank questions.
@hakan_cetinkaya
In this case I want to make it mandatory, I want the user to fill in all options, such that were they are not providing a service, they input 0.
Hence does the statement change to this below:
I can’t access to your forms through KoBo I’m just someone who is part of the community not the Core Team.
If you can download your form as .xls file and share with me I’ll be happy to look further. To do that, you can click on your Projects and when you click the More actions button, you can download your form in xls format.