When you need to classify data based on certain conditions, assign corresponding values to different sorts of data, and finally create a column to store the data, using the IF function is an appropriate approach.
Functions such as AND, OR, and FIND are often nested inside the IF function for use.
For example, you want to implement fuzzy search, classify data based on certain conditions, assign corresponding values to different sorts of data, and create a column to store the data.
Drag a New Calculation Column operator into the Data Transformation node. Add a field and name it Category to label values containing Women as Women Products, Men as Men Products, or otherwise, as Others.
Enter the formula IF(FIND("Women",Category description)!=0,"Women Products",IF(FIND("Men",Category description)!=0,"Men Products","Others")), as shown in the following figure.
The following table describes the formula.
FIND("Women's",Category_Description) != 0
Returns 1 if the Category field contains Women, otherwise, returns 0.
IF(FIND("Women's",Category_Description) != 0,"Women's Products",IF(FIND("Men's",Category_Description) != 0,"Men's Products","Others"))
Labels values of the Category field containing Women as Women Products, Men as Men Products, or otherwise, as Others.
The Data Preview page displays the new column, as shown in the following figure.
Drag a New Calculation Column operator into the Data Transformation node. Add a field and name it Category to label data meeting the conditions Sales_Volume>5000 and Profit>500 as Excellent, or otherwise, as Others.
Enter the formula IF(AND(Sales_Volume>5000,Profit>500),"Excellent","Others"), as shown in the following figure.
IF(AND(Sales_Volume>5000,Profit>500),"Excellent","Others")
Returns Excellent If both conditions are met. Otherwise, returns Others.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy