Capturing age in years and months

Hello team
Am capturing age in years and months .I have created another variable using assign that should multiply the age in years by 12 then adds it age in months but am getting an error in the application designer ‘Error: Error: Invalid or unexpected token interpretting formula’
Anybody who has done this. Please help

This error is telling you that you included something in the assign formula that is not valid. Maybe you typed & when you meant + for example. Please share the formula or excel that is generating this error if you aren’t able to figure it out when examining the formula itself.

Many thanks @elmps2018
Here is my formula. Its now able to go past the application designer but stops the app when I reach the page it is read. Any lead
“(data(age1) *12 )

1 Like

Many thanks @elmps2018
I have managed to sort it out using sample adult coverage calculates

This hasn’t worked. It was able to compute on the note but not saving on the database. It is missing in the database. Any help will be needed.

One immediate issue I can see is with the data calls. They should be:
data(‘age1’) with the single quotes
not data(age1) no quotes.
See the instructions for calculations here: Using ODK-X XLSX Converter — ODK-X Docs – using calculations section.

Also make sure the variable you are assign-ing is in the model. So if it’s age3 it needs to be defined in the model statement as an integer. Check if it is in the database as a column as that may be the issue. You’ll also need to have the assign refer to that variable, so the type would be assign and the name would be age3 with that calculation in the same line.

1 Like