QuestionQ48

VerifiedPrepare data and use feature engineering in Snowflake

A Data Scientist has a column in a table containing the values “Yes” and “No” and wants to convert them to 1 and 0 instead. The transformation must be included in a SELECT statement.

Which functions can accomplish this?

Choose two
Explanation

DECODE compares a column expression to specified values and returns the corresponding result, so it can map “Yes” to 1 and “No” to 0. IFF returns one of two expressions based on a Boolean condition, so it can return 1 when the value is “Yes” and 0 when it is not. Snowflake DECODE documentation Snowflake IFF documentation

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!