Need to write query for transformation rule

if "source value" is not required and 'source value' = blank ,null or space then set value to 1 for NA else retrieve column name (Ex: "CD_MPPNG_KK") where lot of columns using and condition. return the value of column name (Ex: "CD_MPPNG_KK") or if no match then return value = 0 or UKN

Provide sample table and data