Adding a Column Using the IF Function describes how to assign values based on specified conditions to form a new data column.
If you only want to perform group assignment on existing data without setting judgment conditions, you can use the built-in formula SWITCH.
This example describes how to assign values to a new column based on the Shipper field, where if the shipper is 1, set the value to Shipper1; if 2, Shipper2; if 3, Shipper3; otherwise, set it to Unknown.
In Data Transformation, after extracting the specified data table, add a New Calculation Column operator, as shown in the following figure.
Click Add Field, set the field name, and click Add Field Value to enter the setting page, as shown in the following figure.
Enter the formula SWITCH(Shipper,1, "Shipper1", 2, "Shipper2", 3,"Shipper3","Unknown"), as shown in the following figure.
Click Data Preview to view the new column, as shown in the following figure.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy