Extract elements from Dataiku variable in SQL query

cclee93
cclee93 Registered Posts: 4
edited July 16 in Using Dataiku

Hello,

I declare a variable List_x in Dataiku project as a tuple of 3 elements A, B and C.

{
  "List_x" : "('A', 'B', 'C')"
}

With SQL query, how could I extract each element of this variable ?

The goal is to use "List_x" in a Case when syntax, like this:

SELECT *,
   CASE WHEN X = List_x(0) THEN 1
        WHEN X = List_x(1) THEN 2
        WHEN X = List_x(2) THEN 3
   END AS Y
FROM TABLE

Thank you in advance for your helps

Answers

Setup Info
    Tags
      Help me…