0 votes
Case when with multiple cases like:

Case

   when

   A= 'B' then  'C'

   A = 'D' then  'E'

   A = 'F' then  ‘G'

else 'NA' end as test

Give me both options, Spark SQL or scripting inside DSS
by

1 Answer

0 votes

You can do :

case when A = 'B' then 'C' else ( 
  case when A = 'D' then 'E' else ( 
    case when A = 'F' then 'G' else 'NA' end 
  ) end 
) end

or in a formula in a Prepare recipe :

if(A=='B','C', if(A=='D','E', if(A=='F','G', 'NA') ) )
by
1,188 questions
1,220 answers
1,363 comments
11,751 users

©Dataiku 2012-2018 - Privacy Policy