Numeric
Text
Date/Time
Boolean
1. If the result of the expression is Value 1, the function returns Result 1. If the result of the expression is Value 2, the function returns Result 2. If there is no matching value, the function returns Other result.
2. If the expression is NULL, the result is NULL.
3. The results must be of the same data type. If you manually input NULL, it is regarded as being of the same type as the other non-null parameter. If all results are manually input NULL, it follows the same logic as manually inputting a single NULL, and field selection is allowed.
4. The data type of the calculation result returned by the expression must be consistent with that of the corresponding assigned value.
For example, drag a New Calculation Column operator into the Data Transformation node and configure it, assign 1 to the new column if the Contract_Type value is Purchase Contract, 2 if Long-Term Agreement, and Others if any other contract types. Enter the formula SWITCH(Contract_Type,"Purchase Contract", "1", "Long-Term Agreement", "2", "Others"), as shown in the following figure.
The new column with assigned values is shown in the following figure.
Adding a Column Using the SWITCH Formula
Adding a Column Using the IF Function
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy