0

Calculated field

Hello, 

I’m new to Ninox and would like to have a calculated field (age category) from birthdate.

I have DatNai field which is birthdate. I created ‘Categorie Age’ that I’d want to populate.

I tried this formula and many variants but I can’t make it work:

switch year(DatNai)
do
case 2014: 'Eveil’

case 2013: ‘Eveil’

default: ‘Senior’

end

Of course I omitted lots of cases, just trying to understand syntax.

Could somebody help me ?

Thanks

2 replies

null
    • alexleguevaques
    • 5 yrs ago
    • Reported - view

    Thanks what I lacked was text casting.

    Here is my working formula :

    switch year(DatNai) do
    case 2014:
    text("Eveil")
    case 2013:
    text("Eveil")
    case 2012:
    text("Mini-Poussin")
    case 2011:
    text("Mini-Poussin")
    case 2010:
    text("Poussin")
    case 2009:
    text("Poussin")
    case 2008:
    text("Benjamin")
    case 2007:
    text("Benjamin")
    case 2006:
    text("Minîme")
    case 2005:
    text("Minîme")
    case 2004:
    text("Cadet")
    case 2003:
    text("Cadet")
    case 2002:
    text("Cadet")
    case 2001:
    text("Junior")
    case 2000:
    text("Junior")
    case 1999:
    text("Junior")
    default:
    text("Senior")
    end

     

    Hope it helps others.

Content aside

  • 5 yrs agoLast active
  • 2Replies
  • 1818Views