isMonth function in the Date and Time functions of the Factory

The isMonth function checks whether the data type of the attribute specified in the string parameter is month.


Parameters

isMonth(string, binary)

Parameter

Description

string

The nominal attribute to be tested. The string parameter is mandatory.

binary

If the optional binary parameter 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.

Month type valid formats (if the values aren’t this format, the function will return a False or 0).

  • 1492/10;

  • 10/1492;

  • 1492-10;

  • 10-1492;

  • 1492/Oct;

  • 1492-Oct;

  • Oct/1492;

  • Oct-1492.


Example

The following example uses the Bike Sales dataset.

Description

Screenshot

In this example, we want to check if the Month attribute is a month attribute.

We add a new attribute and write the following formula:

isMonth($"Month")

As we haven’t specified the binary parameter, True has been set as default, so the results will be provided as Booleans.

As the values aren’t written in one of the formats above, the function has returned False, as this format is undoubtedly nominal.