Built-in Functions → quarterDay

quarterDay() is a conversion function that returns the count of days from the beginning of the quarter for the current date.

Note

To return the quarter’s count of days for a given date or timestamp, use the quarterDay() conversion function with a parameter.

Signature

```quarterDay()
```

Returns

`int` representing the count of days of a quarter for the current date.

Example

Identify the day number of the quarter, for the current date, 08/26/2021.

```quarterDay()
```

The following table illustrates the behavior of the quarterDay() conversion function:

ProductRevenuesquarterDay()
CD\$20057
Hard disk\$60057
Cable\$55057
Hardware\$80057
Memory Card\$22057

The current date is August 26th and July has 31 days. Thus, the quarterDay() of the current quarter (Q3: July, August, and September) is (31 + 26) = 57.

Use the following steps for detailed instructions on how to use the quarterDay() conversion function to tackle the above example in an insight::

Note

In the Cluster Management Console (CMC), create a tenant that includes Sample Data. The Sample Data includes the SALES schema.

• In the Navigation bar, select the Content tab, and then select + New → Add Dashboard.
• In the Add Dashboard dialog, for Name, enter Product Dashboard, and then select Add.
• In the Action bar, select + (add icon), or select + Add Insight.
• In the Insight panel, select Listing Table or V.
• In Tables, select Aggregated Table.
• In the Data panel, select Manage Dataset.
• In the Manage Data Sets panel, in Tables, select SALES. Close the panel.
• From the Data panel, drag and drop the following columns to the respective tray:
• Category from the PRODUCTS table to the Grouping Dimension tray.
• Revenue from the SALES table to the Measure tray.
• In the Properties panel, for Number Format, select Dollar Rounded.
• From the Data panel, drag and drop Add Formula to the Grouping Dimension tray.
• The Formula Builder automatically opens:
• In Search Functions, select the down arrow, and then select Conversion Functions.
• Double-click the second quarterDay function, `quarterDay()`, to add the formula to the editor.
• Select Validate & Save.
• In the Properties panel, for Column Label, enter quarterDay().
• Name the insight Revenue Per Category.
• In the Action bar, select Save.