I have a similar problem…
The problem is that I cannot compare dates for the calculation.
What I need is:
Q1: Survey date
Q2: Harvest questions (only for the months of March, April and May)
Q3: planting questions (only for September and October)
How can I make the logical skip in that case?
Alguien sabe cómo puedo conseguir que un grupo de preguntas aparezca o desaparezca dependiendo de una pregunta inicial de fecha??
La idea es que dependiendo del mes de año en el que estemos aparezca un grupo de preguntas u otro, entonces el año no importa, lo que importa es el mes en el que se rellena el cuestionario
Does anyone know how I can get a group of questions to appear or disappear depending on an initial date question?
The idea is that depending on the …
I have moved your discussion into a new topic since this is an advanced calculation with dates. I would recommend the following approach.
Extract the number of days using decimal-date-function and subtract the first date of the year from it.
Create a skip logic using the days’ bands that fit within the months you expect.
See screenshot below
Use month as skip routine.xlsx (19.1 KB)
Test this on
ODK - XLSForm Online v2.x and preview.
Thank you so much!!!
I think, you could also just use the %n option to directly select the month from the survey date (and check it against 3, 4, 5 in your harvest relevant and against 9, 10 for the planting relevant)… See
And how exactly would the calculation formula be? Like this?
@elvira_rios, this post discussed previously should help you explain how the formula looks like:
Nope. The format used to submit results to the server of type date is prescribed and fixed by the
XForms specification. However you can convert to/from pretty much any custom format you desire using the format-date() function.
For example, to get something like “09/10/19” you can use:
If you use this in a calculation, your calculation result will contain your date in your desired format when submitted to your server.