Problem with warning note and skips

may you help on displaying a warning when a birth date is greater than a migration date, in my form i get an error every time am trying to fix, it gives an error that i have described on message error column, here is my form. from row 26 on survey sheet.
baseline.xlsx (21.1 KB)

Hi @Godfrey_John! I am not sure what you mean “I have described on message error column,” but tried to take a look. So in testing the form a few points.

  1. Because you have this as an if and note rather than a constraint, it shows up at undesirable times (like when the date of residency is blank). You want to do this as a constraint, as you have done with some of the other ones.
  2. I am not sure if you need the baseline piece for the constraint. Also, part of the difficulty may be coming from needing parentheses if you do.
  3. If you move this into the constraint, you will want parentheses, something like: (data(‘dateOfMigration’) <= now()) && (data(‘dateOfBirth’) > data(‘dateOfMigration’) )

Hopefully this helps but let us know any follow ups, and if you are still getting an error message please screenshot and describe a bit more.

1 Like

thanks for the guide, i have an xls form that is in xls form which is compactible with odk just, i need to transfer it to the format that will be compactible with odk-x, this is my origin form to be transformed. can you help me to structure it so that it can be compactible with odk-x, if i get a ggod format i will proceed with the rest of the forms.

baseline.xlsx (20.7 KB)

on row number 23, i need to set that relevant condition.

Hi @Godfrey_John! Did the suggestions above not work to create the condition? Or do you have a different problem now?

1 Like

yes, i would like to know what is an alternative for relative column in odk-x?

I am not sure what you mean by the relative column, but if you are thinking about whether or not something is relevant, the required column does that. Otherwise you can use else/if clause + condition columns to do skip patterns.

1 Like

The if/else concept replaced relevance to allow easier grouping of questions and complex logic.

1 Like

i have this condition " ${dateOfBirth}>${dateOfMigration} and …/migrationType = ‘BASELINE’ " placed in relevant column, now i need to use either the if statement to display the note when the condition is true or any approach to fulfill my need, i have tried the suggestion way but it gives me the constraint message no matter the condition is true or false.

@Godfrey_John So there is not a “relevant” column in ODK-X and you’ll need to use the ODK-X syntax (if/else). There may be an issue with how you set up your syntax for the if/else. Can you share the version with the if/else syntax? Also, the grouping within screens and treatment of missings may be an issue.

1 Like

here is a form with if else statement as well as a screenshot for the message i get.
baseline.xlsx (21.1 KB)

@Godfrey_John Ah-ha, I think I see the problem now. You have TRUE in the required column for the note. Because it’s just a note I don’t think it should have a name or be required, there’s no way you can answer a note.

1 Like

how about my if statement? is it well written?

@Godfrey_John that looks fine, but let us know if after you fix the other issues if there are any questions still. Also splitting this topic off since it’s not actually a data difference issue.

3 posts were split to a new topic: Conditional calculations