isbool()

Table of Contents

Definition

isbool() takes a value and determines whether or not it is a Boolean data type. If the value is a Boolean data type, this function returns true.

Examples

The following example generates new columns 'isBool' and 'isNotBool' with eval command. if() function inserts either 'true' or 'false' in both columns, depending on if the criteria for isbool() function is met. The first isbool() returns 'true' because 0==1 is a boolean value. The second one returns 'false' because it’s a string value.

| makeresults
| eval isBool = if(isbool(0==1), "True", "False")
| eval isNotBool = if(isbool("a"), "True", "False")
Screenshot of the previous example’s result

Further Reading