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.
The default MonthNames definition is used. In the load script, the Month function is used with the date field as the provided argument.
In the results table, the output of this Month function displays the months of the year in the format of the MonthNames definition.
Example 2 - Change system variable
Overview
Open the Data load editor and add the load script below to a new tab.
The load script contains:
A dataset of dates that is loaded into a table named Transactions.
A date field.
The MonthNames variable that is modified to use the abbreviated months in Spanish.
Load script
Set MonthNames='Enero;Feb;Marzo;Abr;Mayo;Jun;Jul;Agosto;Set;Oct;Nov;Dic';
Transactions:
LOAD
date,
month(date) as month,
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
monthname
Create this measure:
=sum(amount)
Results table
date
monthname
sum(amount)
01/01/2022
Enero
1000.45
01/02/2022
Enero
2123.34
01/03/2022
Enero
4124.35
01/04/2022
Enero
2431.36
01/05/2022
Enero
4787.78
01/06/2022
Enero
2431.84
01/07/2022
Enero
2854.83
01/08/2022
Enero
3554.28
01/09/2022
Enero
3756.17
01/10/2022
Enero
3454.35
In the load script, first the MonthNames variable is modified to list the months of the year abbreviated in Spanish. The Month function is used with the date field as the provided argument.
In the results table, the output of this Month function displays the months of the year in the format of the MonthNames definition.
It is important to remember that if the language for the MonthNames variable is modified like it has been in this example, the LongMonthNames variable would still contain the months of the year in English. The LongMonthNames variable would have to be modified if both variables are used in the application.
Example 3 – Date function
Overview
Open the Data load editor and add the load script below to a new tab.
The load script contains:
A dataset of dates that is loaded into a table named Transactions.
Load the data and open a sheet. Create a new table and add these fields as dimensions:
date
monthname
Create this measure:
=sum(amount)
Results table
date
monthname
sum(amount)
01/01/2022
Jan
1000.45
01/02/2022
Jan
2123.34
01/03/2022
Jan
4124.35
01/04/2022
Jan
2431.36
01/05/2022
Jan
4787.78
01/06/2022
Jan
2431.84
01/07/2022
Jan
2854.83
01/08/2022
Jan
3554.28
01/09/2022
Jan
3756.17
01/10/2022
Jan
3454.35
The default MonthNames definition is used. In the load script, the Date function is used with the date field as the first argument. The second argument is MMM.
Using this formatting Qlik Sense converts the values from the first argument into the corresponding month name set in the variable MonthNames. In the results table, the field values of our created field month display this.
Variable
A variable in Qlik Sense is a container storing a static value or a calculation, for example a numeric or alphanumeric value.
A field contains values, loaded from a data source. At a basic level, a field corresponds to a column in a table. Fields are used to create dimensions and measures in visualizations.
The term dataset is sometimes synonymous with table. It can refer to the original source table, the table after undergoing transformations, or the fact and dimension tables in a data mart.
It can also refer to a logical table, where there are several instance tables and views:
Current data
History, which holds previous versions of the table
A measure is a calculation base on one ore more aggregations. For example, the sum of sales is a single aggregation, while the sum of sales divided by the count of customers is a measure based on two aggregations.
The load script is a sequence of statements that defines what data to load and how to link the different loaded tables. It can be generated with the Data manager, or with the Data load editor, where it also can be viewed and edited.
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. The information does not usually directly identify you, but it makes the site work as you expect it to and can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
Privacy & Cookie Notice
Manage Consent Preferences
Strictly Necessary Cookies
Always Active
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work.
Functional Cookies
These cookies enable the website to provide enhanced functionality and personalization. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies, then some or all of these services may not function properly. These cookies do not typically store personal information enabling us to identify you, but are based on uniquely identifying your browser and internet device.
Performance Cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site and make it easier to navigate. For example, they help us to know which pages are the most and least popular and see how visitors move around the site. When analyzing this data it is typically done on an aggregated (anonymous) basis.
Advertising Cookies
These cookies may be set through our site by our advertising partners to build a profile of your interests and show you relevant advertisements on other sites. They do not typically store personal information enabling us to identify you, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less relevant advertising.