# DayNames

The format defined replaces the weekday names convention set by your regional settings.

Syntax:

DayNames

When modifying the variable, a semicolon ` ;  `is required to separate the individual values.

DayName Function examples

| Function example | Result definition |
| --- | --- |
| ` Set DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';  ` | This use of the DayNames function defines day names in their abbreviated form. |
| ` Set DayNames='M;Tu;W;Th;F;Sa;Su';  ` | This use of the DayNames function defines day names by their first letters. |

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

Related functions

| Function | Interaction |
| --- | --- |
| [weekday - script and chart function](https://help.qlik.com/en-US/sense/May2025/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFunctions/weekday.htm) | Script function to return ` DayNames  `as field values . |
| [Date - script and chart function](https://help.qlik.com/en-US/sense/May2025/Subsystems/Hub/Content/Sense_Hub/Scripting/FormattingFunctions/Date.htm) | Script function to return ` DayNames  `as field values. |
| [LongDayNames](https://help.qlik.com/en-US/sense/May2025/Subsystems/Hub/Content/Sense_Hub/Scripting/NumberInterpretationVariables/LongDayNames.htm) | Long form values of `DayNames`. |

## 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 - System variables default

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/NumberInterpretationVariables/DayNames.htm)

#### Load script and results

Overview

In this example, the dates in the dataset are set in the MM/DD/YYYY format.

Open the Data load editor and add the load script below to a new section.

The load script contains:

* A dataset with dates, which will be loaded into a table named, `Transactions`.

* A `date` field.

* The default `DayNames` definition.

Load script

```
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun'; 

Transactions: 
LOAD 
date, 
WeekDay(date) as dayname, 
id, 
amount 
INLINE  
[ 
date,id,amount 
01/01/2022,1,1000 
02/01/2022,2,2123 
03/01/2022,3,4124 
04/01/2022,4,2431 
]; 
```

Results

Load the data and open a sheet. Create a new table and add these fields as dimensions:

* `date`

* `dayname`

Create this measure:

`sum(amount)`

Results table

| date | dayname | sum(amount) |
| --- | --- | --- |
| 01/01/2022 | Sat | 1000 |
| 02/01/2022 | Tue | 2123 |
| 03/01/2022 | Tue | 4124 |
| 04/01/2022 | Fri | 2431 |

In the load script, the `WeekDay` function is used with the `date` field as the provided argument. In the results table, the output of this `WeekDay` function displays the days of the week in the format of the `DayNames` definition.

## Example 2 - Change system variable

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/NumberInterpretationVariables/DayNames.htm)

#### Load script and results

Overview

Open the Data load editor and add the load script below to a new tab. The same dataset and scenario from the first example are used.

However, at the start of the script, the `DayNames` definition is modified to use the abbreviated days of the week in Afrikaans.

Load script

```
SET DayNames='Ma;Di;Wo;Do;Vr;Sa;So'; 
						
Transactions: 
Load 
date, 
WeekDay(date) as dayname, 
id, 
amount 
Inline  
[ 
date,id,amount 
01/01/2022,1,1000 
02/01/2022,2,2123 
03/01/2022,3,4124 
04/01/2022,4,2431 
]; 
```

Results

Load the data and open a sheet. Create a new table and add these fields as dimensions:

* `date`
* `dayname`

Create this measure:

`sum(amount)`

Results table

| date | dayname | sum(amount) |
| --- | --- | --- |
| 01/01/2022 | Sa | 1000 |
| 02/01/2022 | Di | 2123 |
| 03/01/2022 | Di | 4124 |
| 04/01/2022 | Vr | 2431 |

In the results table, the output of this `WeekDay` function displays the days of the week in the format of the `DayNames` definition.

It is important to remember that if the language for the `DayNames` is modified like it has been in this example, the `LongDayNames` would still contain the days of the week in English. This would need to be modified as well if both variables are used in the application.

## Example 3 – Date function

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/NumberInterpretationVariables/DayNames.htm)

#### Load script and results

Overview

Open the Data load editor and add the load script below to a new section.

The load script contains:

* A dataset with dates, which will be loaded into a table named, `Transactions`.

* A `date` field.

* The default `DayNames` definition.

Load script

```
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun'; 

Transactions: 
Load 
date, 
Date(date,'WWW') as dayname, 
id, 
amount 
Inline  
[ 
date,id,amount 
01/01/2022,1,1000 
02/01/2022,2,2123 
03/01/2022,3,4124 
04/01/2022,4,2431 
]; 
```

Results

Load the data and open a sheet. Create a new table and add these fields as dimensions:

* `date`
* `dayname`

Create this measure:

`sum(amount)`

Results table

| date | dayname | sum(amount) |
| --- | --- | --- |
| 01/01/2022 | Sat | 1000 |
| 02/01/2022 | Tue | 2123 |
| 03/01/2022 | Tue | 4124 |
| 04/01/2022 | Fri | 2431 |

The default `DayNames`definition is used. In the load script, the `Date` function is used with the `date` field as the first argument. The second argument is `WWW`. This formatting converts the result into the values stored in the `DayNames` definition. This is displayed in the output of the results table.