Skip to main content Skip to complementary content

monthname - script and chart function

This function returns a display value showing the month (formatted according to the MonthNames script variable) and year with an underlying numeric value corresponding to a timestamp of the first millisecond of the first day of the month.

Syntax:  

MonthName(date[, period_no])

Return data type: dual

Diagram of monthname function

Example diagram of monthname function, showing how the function returns the combined result of a month and year when given a specific input date.
Arguments
Argument Description
date The date or timestamp to evaluate.
period_no period_no is an integer, which, if 0 or omitted, indicates the month that contains date. Negative values in period_no indicate preceding months and positive values indicate succeeding months.
Function examples
Example Result
monthname('10/19/2013') Returns Oct 2013
monthname('10/19/2013', -1) Returns Sep 2013

Regional settings

Unless otherwise specified, the examples in this topic use the following date format: MM/DD/YYYY. The date format is specified in the SET DateFormat statement in your data load script. The default date formatting may be different in your system, due to your regional settings and other factors. You can change the formats in the examples below to suit your requirements. Or you can change the formats in your load script to match these examples. For more information, see Modifying regional settings for apps and scripts.

Default regional settings in apps are based on the user profile. These regional format settings are not related to the language displayed in the Qlik Cloud user interface. Qlik Cloud will be displayed in the same language as the browser you are using.

If you are an app creator, you can set the default region for apps you create. For more information, see Setting your preferred regional settings for creating apps and scripts in Qlik Cloud Analytics.

Example 1 – Basic example

Example 2 – period_no

Example 3 – Chart object example

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!