Bu fonksiyon, expression öğesinin kesri standart sayı yorumlamasına göre saat olarak yorumlandığında, saniyeyi temsil eden bir tamsayı döndürür.
Söz Dizimi:
second (expression)
Dönüş verileri türü: tamsayı
Ne zaman kullanılır?
second() fonksiyonu, saniyeye göre toplamaları karşılaştırmak istediğinizde yararlıdır. Örneğin, saniyeye göre etkinlik sayısı dağılımını görmek istediğinizde bu fonksiyon kullanılabilir.
Bu boyutlar, Ana Takvim tablosunda bir alan oluşturmak için fonksiyon kullanılarak komut dosyasında oluşturulabilir veya grafiğin içinde doğrudan bir hesaplanan boyut olarak kullanılabilir.
Fonksiyon örnekleri
Örnek
Sonuç
second(
'09:14:36' )
36 döndürür
second(
'0.5555' )
55 sonucunu döndürür (Çünkü 0,5555 = 13:19:55)
Bölgesel ayarlar
Aksi belirtilmedikçe bu konudaki örneklerde aşağıdaki tarih formatı kullanılır: AA/GG/YYYY. Tarih formatı, veri yükleme kodunuzda SET DateFormat deyiminde belirtilir. Varsayılan tarih formatı, bölgesel ayarlarınız ve diğer unsurlar nedeniyle sisteminizde farklı olabilir. Aşağıdaki örneklerdeki formatları ihtiyaçlarınıza uyacak şekilde değiştirebilirsiniz. Dilerseniz yükleme kodunuzdaki formatları aşağıdaki örneklere uyacak şekilde değiştirebilirsiniz. Daha fazla bilgi için bkz. Uygulama bölge ayarlarını değiştirme.
Uygulamalardaki varsayılan bölgesel ayarlarda kullanıcı profili temel alınır. Bu bölgesel format ayarları, Qlik Cloud kullanıcı arayüzünde görüntülenen dil ayarlarıyla ilgili değildir. Qlik Cloud, kullandığınız tarayıcıyla aynı dilde görüntülenir.
Komut dosyası ilk örnek ile aynı veri kümesini ve senaryoyu içerir. Ancak bu örnekte uygulamaya değiştirilmemiş veri kümesi yüklenmektedir. second değerleri grafik nesnesindeki bir hesaplama aracılığıyla hesaplanır.
Verileri yükleyin ve bir sayfa açın. Yeni bir tablo oluşturun ve şu alanı boyut olarak ekleyin:date.
Şu hesaplamayı oluşturun:
=second(date)
Sonuçlar tablosu
tarih
=second(date)
01/01/2022 10:10:22 PM
22
01/02/2022 8:35:54 AM
54
01/03/2022 5:40:49 AM
49
01/03/2022 2:21:53 PM
53
01/04/2022 6:49:38 PM
38
01/05/2022 7:04:57 PM
57
01/05/2022 7:34:46 PM
46
01/06/2022 8:49:09 AM
9
01/06/2022 11:29:38 AM
38
01/06/2022 10:58:34 PM
34
second için değerler, second() fonksiyonu kullanılarak ve grafik nesnesinin bir hesaplamasında ifade olarak tarih geçilerek oluşturulur.
Örnek 3 – Senaryo
Genel bakış
Veri yükleme düzenleyicisini açın ve aşağıdaki yükleme kodunu yeni bir sekmeye ekleyin.
Yükleme kodu şunları içerir:
Belirli bir festivalin bilet satışı web sitesine yönelik trafiği temsil etmek için oluşturulan zaman damgalarının yer aldığı bir veri kümesi. Bu zaman damgaları ve buna karşılık gelen bir id, Web_Traffic adlı tabloya yüklenir.
TimeStamp sistem değişkeni M/D/YYYY h:mm:ss[.fff] TT kullanılır.
Bu senaryoda, 20 Mayıs 2021'de sabah 9:00'da satışa çıkarılmış 10000 bilet vardı. Bir dakika sonra biletler tükenmişti.
Kullanıcı, saniyeye göre web sitesine yönelik ziyaretlerin sayısını gösteren bir grafik nesnesi istemektedir.
Komut dosyası
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
tmpTimeStampCreator:
load
makedate(2022,05,20) as date
AutoGenerate 1;
join load
maketime(9+floor(rand()*2),0,floor(rand()*59)) as time
autogenerate 10000;
Web_Traffic:
load
recno() as id,
timestamp(date + time) as timestamp
resident tmpTimeStampCreator;
drop table tmpTimeStampCreator;
Sonuçlar
Aşağıdakileri yapın:
Verileri yükleyin ve bir sayfa açın. Yeni bir tablo oluşturun.
Ardından aşağıdaki ifadeyi kullanarak hesaplanan boyutlar oluşturun:
=second(timestamp)
Toplam giriş sayısını hesaplamak için bir toplama hesaplaması oluşturun:
=count(id)
Sonuçlar tablosu aşağıdaki tabloya benzer olur ancak toplama hesaplaması için farklı değerler içerir:
Sonuçlar tablosu
second(timestamp)
=count(id)
0
150
1
184
2
163
3
178
4
179
5
158
6
177
7
169
8
149
9
186
10
169
11
179
12
186
13
182
14
180
15
153
16
191
17
203
18
158
19
159
20
163
+ 39 satır daha
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.
A field is a data asset containing 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 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.
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.
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 term dataset is usually 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.
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.