Forum Discussion

MiguelFrancis3's avatar
MiguelFrancis3
Qrew Member
7 months ago

CASE Function usage with ranges

Hi All,

Has anyone used the CASE function based on a range of a value, is not working the syntax for me... see below what I need in general... 

CASE([AGE],

<=12,"Child"

> 13 AND <=19,"Teen"

>19 AND <=21, "Young Adult"

>21 "Adult"

)

Thanks in advance...



------------------------------
Miguel Francis
------------------------------

2 Replies

  • You'll need to use more basic if syntax, Case statement evaluate for exact comparators so better served for conditions like multiple choice fields or option sets that are fixed. In your case - you would do an if statement like: 

    If( 

         [Age]<=12, "Child",

         [Age]<=19, "Teen",

         [Age]<=21, "Young Adult",

    "Adult")



    ------------------------------
    Chayce Duncan
    ------------------------------
    • MiguelFrancis3's avatar
      MiguelFrancis3
      Qrew Member

      Thanks! That worked perfectly!!!!

      Regards!



      ------------------------------
      Miguel Francis
      ------------------------------