Skip logic based on birthdate ranges

Hi there,

I am trying to set a relevant skip logig based on the age of babies, this age is introduced by date type of question, not by an integer, how can I make a relevant to show only when the age is from 0 to 6 months and another for 7 to 24 months?

thaks a lot

Could you attach your form? Then I can try to add what you need.


Hi Grzegorz,

Finnaly I decided to solve this issue adding a calculate for months based on the birthdate and setting the relevant skip logic based on that.

Mother_And_Baby_Area.xls (84 KB)

Ok, that's great. Don't hesitate to ask in case of any problems.

Hi again Grzegorz,

i am now facing a problem with the format change into months... the xlm converter sais the following:

Conversion errors:
There has been a problem trying to replace ${format-date(${Child_Birth} with the XPath to the survey element named 'format-date(${Child_Birth'. There is no survey element with this name.

I cant find the way to calculate the age in months so I can base on that the skip logic afterwards (row 23)...

can you help me?

Here yo have the form sample

Mother_And_Baby_Area.xls (82 KB)

I'm not an expert and I haven't tested it but just looking at the file: shouldn't it be
instead of
int(format-date(today(),'%n'))-int(${format-date(${Child_Birth},'%n')}) ?

1 Like

This is calculating the years. But, I want to calculate the age in days. Is this possible?

trying using decimal-date-date() instead, which returns days. eg

decimal-date-date(today()) - decimal-date-date(${Child_Birth})

Thank you. I found the age in days by this example. But, when I went to use this days calculation in another question in relevance field, it is not working.. Can you help me?