Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Tell us which business and trade publications you read most regularly: RESPOND NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
QlikSenseUser1
Contributor III
Contributor III

Max timestamp (incremental load)

Hi, 

I have successfully implemented incremental load routines when I apply max operators on continuous variables. 
However, I need to apply the max operator on my timestamp to save it as a variable and subsequently only load date after that variable. My timestamp column is called STIME and has following format 'YYMMDD hh:mm':

Timestamp.PNG

 

"Max_date:
Load
max(STIME) as Maxdate
From...;
Let Maxdate=floor(peek('Maxdate')); 

is what I used. It works on a continuous variable, not on my timestamp though. Any ideas? 

THANKS

6 Replies
JustinDallas
Specialist II
Specialist II

Are you re/de-formatting your STIME correctly to let Qlik know how to create a Timestamp object?  I tested it with the following code, and it seems to work for me.  Or are you saying that you can get the Timestamp object, it's just that something is getting broken with the Peek/Max logic.  Let's start here.

 

Timestamps:
LOAD Timestamp(MAX(TimestampFormatted))
;
LOAD *, Timestamp(Timestamp#(STIMEText, 'YYMMDD hh:mm')) AS 'TimestampFormatted'
;
LOAD * Inline
[
	'STIMEText'
    '181203 23:50'
    '181203 23:50'
    '181203 23:50'
    '181203 23:51'
]
;

EXIT Script
;

 

 

JustinDallas
Specialist II
Specialist II

I responded to this earlier, but the forum just sent my response into the ether. I think there might be a problem with your formatting, in how you are telling QlikSense to turn your STIME into a Timestamp.

 

Try the following code and let me know what happens.

 

Timestamps:
LOAD Timestamp(MAX(TimestampFormatted))
;
LOAD *, Timestamp(Timestamp#(STIMEText, 'YYMMDD hh:mm')) AS 'TimestampFormatted'
;
LOAD * Inline
[
	'STIMEText'
    '181203 23:50'
    '181203 23:50'
    '181203 23:50'
    '181203 23:51'
]
;

EXIT Script
;

 

 

JustinDallas
Specialist II
Specialist II

I keep responding to this post, but the forum won't take it.

QlikSenseUser1
Contributor III
Contributor III
Author

Hi just received a reply, saying that you are trying. 

chrishayes
Contributor III
Contributor III

Try using SET instead of LET. Also I do not think you need to use Floor() as that will change the time to 00:00. Unless, of course, that is what you are trying to do. You could try using the Timestamp() function if you want the variable stored in the same format. Just make sure you've set your TimestampFormat variable at the top of your script to match the format you are using.

JustinDallas
Specialist II
Specialist II

I think it has to do with your Timestamp format not being recognized by Qlik.  You have to tell Qlik what the format of your STIME string is so it can create  the timestamp.  Try something like this

 

LOAD Timestamp(MAX(TimestampFormatted))
;
LOAD *, Timestamp(Timestamp#(STIMEText, 'YYMMDD hh:mm')) AS 'TimestampFormatted'
;
LOAD * Inline
[
'STIMEText'
'181203 23:50'
'181203 23:50'
'181203 23:50'
'181203 23:51'
]
;