Skip to main content
Question

CASE Function usage with ranges

  • Nov 17, 2023 8:51 PM UTC
  • 0 replies
  • 281 views

Forum|alt.badge.img+2

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
------------------------------
This topic has been closed for replies.

Forum|alt.badge.img+9
  • Qrew Colonel
  • Nov 17, 2023 9:06 PM UTC

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
------------------------------