isQuarter function

The isQuarter function checks whether the data type of the attribute specified in the string parameter is quarter.


Parameters

isQuarter(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.

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

  • 2019/Q3;

  • Q3/2019;

  • 2019-Q3;

  • Q3-2019.


Example

The following example uses the Quarterly Sales dataset.

Description

Screenshot

In this example, we want to check if the Quarter attribute is a quarter attribute.

We add a new attribute and write the following formula:

isQuarter($"Quarter")

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

The function has returned False, because the values aren’t written in one of the formats above.