Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
epocin31
Contributor II
Contributor II

Create table with measures and add timestamp for each data reload

Hello all,

I am beginning my Qlik journey and I would like to create a table with Measures and timestamps. Ideally a new line would be added  for each data reload.

Timestamp (data reload) Measure1 Measure2 Measure3
08/13/24 1 2 3
08/16/24 5 4 1

...

... ... ...

 

FYI, Measures are just a COUNT functions with different IF conditions. I already created them in the Master items part but I can move/delete them if its not appropriate.

Thanks a lot for your help

Labels (4)
1 Solution

Accepted Solutions
Mark_Leifeld
Partner - Contributor III
Partner - Contributor III

Hi Epocin31, 

 

there ist a function called ReloadTime( )

This function returns a timestamp for when the last data load finished. It can be used in both the data load script and in a chart expression.

If you want to save the reload time from past reloads you have to store it anywhere. 

In script I would use the function Now(1) (https://help.qlik.com/de-DE/sense/May2024/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFunc...)

A script could look like:

ReloadTimes: 
Load
[Reload ID],
[Reload Time]
From [lib://DataFiles/ReloadTimes.qvd](qvd);
Concatenate(ReloadTimes)
 
tmp:
load
FieldValueCount('Reload ID')+ 1 as [Reload ID],
now(1) as [Reload Time]
Autogenerate 1;
 
STORE ReloadTimes INTO [lib://DataFiles/ReloadTimes.qvd](qvd);
 
For the first run you can use the following script to initially create the ReloadTimes.qvd . 

ReloadTimes: 
load

1 as  [Reload ID],
now(1) as [Reload Time]

Autogenerate 1; 

STORE ReloadTimes INTO [lib://DataFiles/ReloadTimes.qvd](qvd);

View solution in original post

3 Replies
Mark_Leifeld
Partner - Contributor III
Partner - Contributor III

Hi Epocin31, 

 

there ist a function called ReloadTime( )

This function returns a timestamp for when the last data load finished. It can be used in both the data load script and in a chart expression.

If you want to save the reload time from past reloads you have to store it anywhere. 

In script I would use the function Now(1) (https://help.qlik.com/de-DE/sense/May2024/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFunc...)

A script could look like:

ReloadTimes: 
Load
[Reload ID],
[Reload Time]
From [lib://DataFiles/ReloadTimes.qvd](qvd);
Concatenate(ReloadTimes)
 
tmp:
load
FieldValueCount('Reload ID')+ 1 as [Reload ID],
now(1) as [Reload Time]
Autogenerate 1;
 
STORE ReloadTimes INTO [lib://DataFiles/ReloadTimes.qvd](qvd);
 
For the first run you can use the following script to initially create the ReloadTimes.qvd . 

ReloadTimes: 
load

1 as  [Reload ID],
now(1) as [Reload Time]

Autogenerate 1; 

STORE ReloadTimes INTO [lib://DataFiles/ReloadTimes.qvd](qvd);

epocin31
Contributor II
Contributor II
Author

Hello Mark,

Thanks a lot it is working well

epocin31_0-1723621069212.png

If I want to add my columns 'Measure1', 'Measure2', Measure3' in this file I just have to  calculate them and add the fields in both parts (1st time and recurrent) of the scripts, correct?

Mark_Leifeld
Partner - Contributor III
Partner - Contributor III

Correct !:)