Case Function



  • Alan Mark

    Hi Jee,

    The CASE plugin is not released, so there is no official documentation for it yet.  It will become available in 6.3.

    Here's an explanation of the expected behavior, it functions similar to SQL CASE:


    CASE(<default value>; <any>; <case 1>; <return value 1>; <case 2>; <return value 2>; ...)


    CASE(<default value>; <boolean condition 1>; <return value 1>; <boolean condition 2>; <return value 2>; ...)


    The CASE function exchanges values for others based on either specific cases or boolean conditions. Each case is evaluated in order. If none of the specified cases apply, the function returns the default value. Parameters must appear in pairs. The return and default values must be of the same type.

    Default values cannot be NULL.


    Comment actions Permalink
  • Jee

    Hi Alan,

    Thanks for your reply.

    But, I am getting syntax error for the below formula,


    Here, If number = 1 - it should return "a" , if number = 2 - return b, if nothing is match - return "d"

    My Input from Sheet1:

    I am not sure what is the error here.


    Comment actions Permalink
  • Alan Mark


    I want to note again that this plugin is not released yet.  It's technically not supported, which is why there is no public documentation.  

    It appears to be unfinished and the first syntax example from the design document is not yet implemented. 

    I did get this working with booleans though.

    CASE( "d"; MATCHES(#number; "1"); "a"; MATCHES(#number; "2"); "b")


    Comment actions Permalink

Please sign in to leave a comment.