Replace column value with designated column if Value Empty

Hi, I want to replace value in column with designated value in another column if found empty.

I use rule engine to help me on this, for instance:

This is my raw data:

Fruit Class Type
Apple A Glass
Orange B
Melon C
Apple D Bottle
Orange E

This is my desired output if found empty:

Fruit Class Type
Apple A Glass
Orange B B
Melon C C
Apple D Bottle
Orange E E

I use rule engine with expression:
MISSING $Type$ => $Class$
TRUE => $Class$

but the output always replace all type column to class column value

Is there anything I did wrong?
Thanks!

Hi @andersenyunan,

looks like only one small adjustment of your rule :slightly_smiling_face:

MISSING $Type$ => $Class$
TRUE => $Type$

Hope this helps, Greetz, Tommy

3 Likes

Hi @tommy

Thanks for the correction :slight_smile: Initially I thought that it didn’t work but somehow realized that I my column was not “?” and need to change it to “?” in order the rule to work

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.