Built-in Functions → quarterStartDate

quarterStartDate() is a conversion function that returns the first date of the quarter for the given date or timestamp.

Signature

quarterStartDate(date_timestamp exp)

The following table illustrates the quarterStartDate() parameter:

ParameterDescription
date_timestamp expThe date or timestamp value to determine the quarter start date from

Returns

date representing the start date of the quarter for the given date or timestamp.

Examples

  • Identify the beginning of the current quarter for the given date, 08/17/2021.

    quarterStartDate(
    date(
    "2021-08-17"
    )
    )
  • Identify the beginning of the current quarter for the given timestamp, 2021-07-20 03:09:11.

    quarterStartDate(
    timestamp(
    "2021-05-20 03:09:11"
    )
    )

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

ProductRevenuesmonthStartDate(date)monthStartDate(timestamp)
CD$20007/01/202104/01/2021
Hard disk$60007/01/202104/01/2021

Use the following steps for detailed instructions on how to use the quarterStartDate() conversion function to tackle the second example above 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 quarterStartDate function, quarterStartDate(), to add the formula to the editor.
    • In the Formula Editor, replace date_timestamp exp with TIMESTAMP("2021-05-20 03:09:11")
quarterStartDate(TIMESTAMP("2021-05-20 03:09:11"))
  • Select Validate & Save.
  • In the Properties panel, for Column Label, enter quarterStartDate().
  • Name the insight Revenue Per Product Category.
  • In the Action bar, select Save.