This post is also about Alteryx function, especially IS functions.
IS function
There are some “Is” function in Alteryx.
- IsEmpty
- IsInteger
- IsNull
- IsNumber
- IsSpatialObj
- IsString
“IS” functions are to check the data type, Null or empty. You can know which function checks which data type or Null/Empty from the function name. For example, IsInteger function is to check the Integer type or not. However, it is necessary to use them properly.
- Cheking the contents of data
- IsEmpty
- IsInteger
- IsNull
- Cheking the data type of the field
- IsNumber
- IsSpatialObj
- IsString
These are easy to misunderstand because there are in the same category, but how to use is quite different.
Let’s see the differences.
IsEmpty、IsInteger、IsNull
These functions are for cheking the value.
IsNull
This function is for checking the Null or not. If the value is null, it returns “True”.
For exmaple, test the “Number” field.
IsEmpty([Number])
The 1st record of Number field is null and IsNull function returns “True”.
IsEmpty
This function is for checking the Null/Empty or not. If the value is empty or null, it returns “True”. When you want to check the data in the numeric field, you should use the IsNull function because there is no empty value.
For example, test the “String” field.
IsEmpty([String])
The 2nd record in the String field is empty value and also 1st record is null. You can see that the IsEmpty function returns “True”.
IsInteger
IsInteger functions is to check the value is integer or not. This can be used for the values in string type field and double/float type field. But if the value contains comma, it doesn’t consider as integer.
Note that when you use IsInteger in numeric field, the null value is considered as integer, but in string field is not considered as integer. If you want to get “False” in that case, you should use it with IsNull function.
For example, test the “String” field which is string type field.
IsInteger([String])
In this case, the Null is as “False”.
Next, test the “Number” field which is Double type.
IsInteger([Number])
In this case, the Null is as “True”.
IsNumber、IsSpatialObj、IsString
These functions are for checking the data type of the field, not data itself. Honesty, there are less cases to use these functions. For exmaple, when you want to change processing depending on the data type of the field in the Multi-Field Formula tool, it will work well.
IsNumber
This function judge the numeric field or not. But it checks the data type, not value itself.
For example, let’s see the String field and Number field.
The results are as follows.
Even if the value of the “String” field is numeric, it is judged “False” because the type of field is string type.
IsString
This function judge the string field or not. But it checks the data type, not value itself.
For example, let’s see the String field and Number field.
The results are as follows.
Even if the value of the “String” field is numeric, it is judged “True” because the type of field is string type.
IsSpatialObj
This function judge the spatial field or not. But it checks the data type, not value itself.
For example, test the field “SOJ_Text” that is changed to VW_String by the Select tool and the spatial field “SOJ” which has null value.
The result is as follows.
“SOJ_Text” is all “False” because that field is string type. The spatial field “SOJ” is “True”. The value “Null” is also “True”.
Conclusion
- I explained “Is” Functions.
- There are two type in IS functions. One is for checking the value itself and another is for checking the data type of the field.
- IsInteger Function returns “True” when the value is Null in the numeric field, but IsInteger function that the value Null in the string field returns “False”
Sample Workflow download
The next blog post
Next, I would like to explain how to get the string type or numeric type the value is.
コメント