isDatetime function in Date and Time functions
The isDatetime function checks whether the data type of the attribute specified in the string parameter is date.
Parameters Parameter Description string The nominal attribute to be tested. The string parameter is mandatory. binary If it is True, or not specified, results will be provided as Booleans (True/False), while if it is False, results will be provided in binary form (1/0). The binary parameter values (True/False) are case sensitive. Datetime type valid formats (if the values aren’t this format, the function will return a False or 0). 2019/05/22 17:33:45isDatetime(string, binary)
Example
The following example uses the isDatetime dataset.
Description | Screenshot |
---|---|
In this example, we want to check if the Date Posted attribute is a Datetime attribute. We add a new attribute and write the following formula:
As we haven’t specified the binary parameter, True has been set as default, so the results will be provided as Booleans and not binary values (0/1). | |
If you want to delete the outliers, you can apply a filter to the isdatetime attribute. In this example, as you can see, the value in row 5 of the Date Posted attribute is not a date, so the function has returned a False. Here, we want to keep only those values which are of Datetime type, where the function has returned True. So, drag the isdatetime attribute onto the Post-filter area and uncheck the False. Then, click Apply and Make Persistent. | |
This is the final result after having post-filtered the isdatetime attribute. |