Skip to main content Skip to complementary content

ReferenceDay

The setting defines which day in January to set as reference day to define week 1. In other words, this setting prescribes how many days in week 1 must be dates within January.

Syntax:  

ReferenceDay

ReferenceDay sets how many days are included in the first week of the year. ReferenceDay can be set to any value between 1 and 7. Any value outside of the 1-7 range is interpreted as the midpoint of the week (4), which is equivalent to ReferenceDay being set to 4.

If you do not select a value for the ReferenceDay setting, then the default value will show ReferenceDay=0 which will be interpreted as the midpoint of the week (4), as seen in the ReferenceDay values table below.

The ReferenceDay function is often used in combination with the following functions:

Related functions
Variable Interaction
BrokenWeeks If the Qlik Sense app is operating with unbroken weeks, the ReferenceDay variable setting will be enforced. However, if broken weeks are being used, week 1 will begin on January 1 and terminate in conjunction with the FirstWeekDay variable setting and ignore the ReferenceDay flag.
FirstWeekDay Integer that defines which day to use as the first day of the week.

Qlik Sense allows the following values to be set for ReferenceDay:

ReferenceDay values
Value Reference day
0 (default) January 4
1 January 1
2 January 2
3 January 3
4 January 4
5 January 5
6 January 6
7 January 7

In the following example the ReferenceDay = 3 defines January 3 as the reference day:

SET ReferenceDay=3; //(set January 3 as the reference day)

Some of the examples below use inline loads. For more information, see Inline loads.

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.

Default regional settings in apps are based on the regional system settings of the computer or server where Qlik Sense is installed. If the Qlik Sense server you are accessing is set to Sweden, the Data load editor will use Swedish regional settings for dates, time, and currency. These regional format settings are not related to the language displayed in the Qlik Sense user interface. Qlik Sense will be displayed in the same language as the browser you are using.

Example 1 - Load script using the default value; ReferenceDay=0

Example - ReferenceDay variable set to 5

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!