Built-in Functions → monthName

monthName() is a conversion function that returns the month name of a given date or timestamp.

Signature

monthName(date_timestamp exp)
ParameterDescription
date_timestamp expThe date or timestamp value to determine the month name from

Returns

string representing the name of the month of the given date or timestamp.

Examples

  • Identify the name of the current month, for the given date, "2021-07-04".
```
monthName(

DATE( "2021-07-04" ) )

```
  • Identify the name of the current month, for the given timestamp, "2021-07-04 11:24:15".

    monthName(
    TIMESTAMP(
    "2021-07-04 11:24:15"
    )
    )

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

ProductRevenuesmonthName()
CD$200July
Hard disk$600July
Cable$550July
Hardware$800July
Memory Card$220July

Use the following steps for detailed instructions on how to use the monthName() conversion 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:
    • Category from the PRODUCTS table to the Grouping Dimension tray.
    • Revenue from the SALES table to the Measure tray.
  • 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 first monthName function, monthName(), to add the formula to the editor.
    • In the Formula Editor, replace date_timestamp exp with TIMESTAMP("2021-07-04 11:24:15")
monthName(TIMESTAMP("2021-07-04 11:24:15"))
  • Select Validate & Save.
  • In the Properties panel, for Column Label, enter monthName().
  • Name the insight Revenue Per Category.
  • In the Action bar, select Save.