This function returns an integer representing the minute when the fraction
of the expression is interpreted as a time
according to the standard number interpretation.
Syntax:
minute(expression)
Return data type: integer
When to use it
The minute() function is useful when you would like to compare aggregations by minute. For example, you could use the function if you would like to see activity count distribution by minute.
These dimensions can be created either in the load script by using the function to create a field in a Master Calendar table. Alternatively, they can be used directly in a chart as a calculated dimension.
Function examples
Example
Result
minute (
'09:14:36' )
Returns 14.
minute (
'0.5555' )
Returns 19 ( Because 0.5555 = 13:19:55 ).
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.
Load the data and open a sheet. Create a new table and add this field as a dimension: timestamp.
Create the following measure:
=minute(timestamp)
Results table
timestamp
minute
2022-01-01 22:10:22
10
2022-01-02 08:35:54
35
2022-01-03 05:40:49
40
2022-01-03 14:21:53
21
2022-01-04 18:49:38
49
2022-01-04 22:58:34
58
2022-01-05 19:04:57
4
2022-01-05 19:34:46
34
2022-01-06 08:49:09
49
2022-01-06 11:29:38
29
The values for minute are created by using the minute() function and passing the timestamp as the expression in a measure for the chart object.
Example 3 – Scenario
Overview
Open the Data load editor and add the load script below to a new tab.
The load script contains:
A dataset of timestamps, which is generated to represent entries at a ticket barrier.
Information with each timestamp and its corresponding id, which is loaded into a table called Ticket_Barrier_Tracker.
The default TimeStamp system variable (M/D/YYYY h:mm:ss[.fff] TT) is used.
The user would like a chart object that shows, by minute, the count of barrier entries.
Load script
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
tmpTimeStampCreator:
load
*
where year(date)=2022;
load
date(recno()+makedate(2021,12,31)) as date
AutoGenerate 1;
join load
maketime(floor(rand()*24),floor(rand()*59),floor(rand()*59)) as time
autogenerate 10000;
Ticket_Barrier_Tracker:
load
recno() as id,
timestamp(date + time) as timestamp
resident tmpTimeStampCreator;
drop table tmpTimeStampCreator;
Results
Do the following:
Load the data and open a sheet. Create a new table.
Create a calculated dimension using the following expression:
=minute(timestamp)
Add the following aggregation measure to calculate total count of entries:
=count(id)
Set the measure's Number formatting to Money.
Results table
minute(timestamp)
=count(id)
0
174
1
171
2
175
3
165
4
188
5
176
6
158
7
187
8
178
9
178
10
197
11
161
12
166
13
184
14
159
15
161
16
152
17
160
18
176
19
164
20
170
21
170
22
142
23
145
24
155
+ 35 more rows
Dimension
In Analytics Services:
A dimension is an entity used to categorize data in a chart. For example, the slices in a pie chart or the bars of a bar chart represent individual values in a dimension. Dimensions are often a single field with discrete values, but can also be calculated in an expression.
A dimension is a dataset in a data mart that forms part of the star schema. Dimension datasets hold the descriptive information for all related fields that are included in the fact table’s records. A few common examples of dimension datasets are Customer and Product. Since the data in a dimension dataset is often denormalized, dimension datasets have a large number of columns.
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.
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.
Charts are objects where calculations, aggregations, and groupings can be made. Graphical visualizations, such as bar charts and pie charts are common examples, but also non-graphical objects such as pivot tables are charts.
A chart consists of dimensions and measures, where the measures are calculated once per dimensional value. If the chart contains multiple dimensions, the measures are calculated once per combination of dimensional values.
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 preceding load is a script construct that allows you to load from the following LOAD or SELECT statement without specifying that source. Preceding loads are often faster than resident loads.
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.
Sheets are components of Qlik Sense apps. They present visualizations to app users so they can explore, analyze, and discover data. Sheets can be public or private.
An aggregation is a calculation using multiple records in the source tables. Often it is a single field aggregated with a function such as sum, count, min, max, or average. For example, the sum of sales.
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.