New to Dataiku DSS? Try out our NEW Quick Start Programs today and get onboarded on the product in just one hour! Let's go

Case when with multiple cases like

UserBird
Dataiker
Dataiker
Case when with multiple cases like
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
0 Kudos
1 Reply
fchataigner2
Dataiker
Dataiker

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') ) )
Labels (4)
A banner prompting to get Dataiku DSS