About the calculation value to a hidden filed

HI Team,
i want to create a hidden value from the other field like
if year is <= 2009 then hidden value show " prevalent Case" and if year is >=2010 & year <=2017 then “Event Case” and if year is >=2018 then “New Case”.
Please help me about this, i am not a coder or app builder.

Thanks & Regards
Naveen

Hi Naveen

you want to create questions of the type “Label” and then type up the label you want to show up

then, on those label’s display conditions, you need to write a condition that returns “true” for when you want it to show up.

so, if you take out the year from the date in a hidden calculation, you can then use that calculation in the validation field of the label, and say something like
year_calc < 2010

here’s a link that gives off a few examples on working with date types
https://confluence.dimagi.com/display/commcarepublic/Calculations+with+Dates+and+Times

and here’s a link about display conditions in general (you can have display conditions for different things in different parts of CommCare)
https://confluence.dimagi.com/display/commcarepublic/Display+Conditions+Overview

if you wish the label to show up to the user, and to also prevent them from moving forward with that submission, just add the value “false()” in the label’s validation conditions. what this will do is tell the form that something is wrong, but only when that label shows up on the form.

HTH

Mazz