Built-in Functions → quarterEndDate

quarterEndDate() is a scalar date function that returns the date of the last day of the current quarter.

Signature

quarterEndDate()

Returns

Date representing the last date of the current quarter.

Example

Consider a case where you want to identify the end of the current quarter and the sales revenue that occurred before the last date of the current quarter, for instance, 6/30/2021.

  • End date of the current quarter
quarterEndDate()
  • Sales prior to quarter end
SALES.SALES.TIME_ID < quarterEndDate()

The following table illustrates the behavior of the quarterEndDate() date function:

ProductRevenuesSales DatequarterEndDate()Sales prior to quarterEndDate()
CD$2006/11/20216/30/2021true
Hard disk$6006/12/20216/30/2021true
Cable$5506/14/20216/30/2021true
Hardware$8006/21/20216/30/2021true
Memory Card$2207/1/20216/30/2021false

Use the following steps for detailed instructions on how to use the quarterEndDate() date function:

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:
    • From the Products table, drag and drop Category to the Grouping Dimension tray.
    • From the Sales table, drag and drop Revenue 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 Date Functions.
    • Double-click the quarterEndDate function, quarterEndDate(), to add the formula to the editor.
    • Select Validate & Save.
    • In the Properties panel, for Column Label, enter quarterEndDate().
  • From the Data panel, drag and drop Add Formula to the Grouping Dimension tray.
    • In the Formula Editor, use the following condition:
      • SALES.SALES.TIME_ID < quarterEndDate()
    • Select Validate & Save.
    • In the Properties panel, for Column Label, enter Sales prior to quarterEndDate().
  • Name the insight Revenue Per Product Category.
  • In the Action bar, select Save.