# Validation Condition in Multiple chose (Year/Month)

**URL:** <https://forum.dimagi.com/t/validation-condition-in-multiple-chose-year-month/5494>\
**Category:** Users\
**Created:** [July 6, 2018, 12:43pm UTC](https://forum.dimagi.com/t/validation-condition-in-multiple-chose-year-month/5494 "2018-07-06T12:43:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmed](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/ahmed/32/557_2.png) [@ahmed](https://forum.dimagi.com/u/ahmed)\
**Post date:** [July 6, 2018, 12:43pm UTC](https://forum.dimagi.com/t/validation-condition-in-multiple-chose-year-month/5494/1 "2018-07-06T12:43:10Z")

</div>

Dear All,

I have a number of age, from 1 to 18 maybe a month and may be a year(month 1-11, Year 1-18), I want to put a condition of choice (year of month)  
If the age of the child in the months allows to give the option of the month and year until the number 11  
If the number 11 exceeds the option of the year only without the month.  
I hope that the explanation is clear

 ![Age%20to%20month%20or%20Year](https://dimagi.b-cdn.net/uploads/default/original/1X/3f739773cbaa494409d7413d24e6ba70678a478a.png)

Best Regards,  
Ahmed

---

<div class="post-metadata">

**Author:** ![Clayton\_Sims](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/clayton_sims/32/496_2.png) [@Clayton\_Sims](https://forum.dimagi.com/u/Clayton_Sims)\
**Post date:** [July 6, 2018, 2:12pm UTC](https://forum.dimagi.com/t/validation-condition-in-multiple-chose-year-month/5494/2 "2018-07-06T14:12:20Z")

</div>

Hi Ahmed,

It sounds like an [if() function](https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions#CommCareFunctions-if) will be able to accomplish what you are looking for.

-Clayton

---

<div class="post-metadata">

**Author:** ![ahmed](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/ahmed/32/557_2.png) [@ahmed](https://forum.dimagi.com/u/ahmed)\
**Post date:** [July 10, 2018, 6:03am UTC](https://forum.dimagi.com/t/validation-condition-in-multiple-chose-year-month/5494/3 "2018-07-10T06:03:08Z")

</div>

Hi Clayton,

thank you for give me the suggestion, but do you know how I can to do in Multiple select.  
Or, can you give me example please.

best,  
Ahmed

---

<div class="post-metadata">

**Author:** ![Clayton\_Sims](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/clayton_sims/32/496_2.png) [@Clayton\_Sims](https://forum.dimagi.com/u/Clayton_Sims)\
**Post date:** [July 17, 2018, 12:52am UTC](https://forum.dimagi.com/t/validation-condition-in-multiple-chose-year-month/5494/4 "2018-07-17T00:52:46Z")

</div>

Hi Ahmed,

I think the easiest way to configure what you are asking about is to actually have two different lookup tables, one which allows selecting month and year, and then one which only allows selecting year.

You can then use a hidden value to 'normalize' to a single value by using whichever one was valid.

-Clayton
