Skip to main content Skip to complementary content

makedate - script and chart function

This function returns a date calculated from the year YYYY, the month MM and the day DD.

Syntax:  

MakeDate(YYYY [ , MM [ , DD ] ])

Return data type: dual

Arguments
Argument Description
YYYY The year as an integer.
MM The month as an integer. If no month is stated, 1 (January) is assumed.
DD The day as an integer. If no day is stated, 1 (the 1st) is assumed.

When to use it

The makedate() function would commonly be used in the script for data generation to generate a calendar. This could also be used when the date field is not directly available as date, but needs some transformations to extract year, month and day components.

These examples use the date format MM/DD/YYYY. The date format is specified in the SET DateFormat statement at the top of your data load script Change the format in the examples to suit your requirements.

Function examples
Example Result
makedate(2012) Returns 01/01/2012.
makedate(12) Returns 01/01/2012.
makedate(2012,12) Returns 12/01/2012.
makedate(2012,2,14) Returns 02/14/2012.

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 – Modified DateFormat

Example 3 – Chart object example

Example 4 – Scenario

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!