Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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':
"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
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 ;
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 ;
I keep responding to this post, but the forum won't take it.
Hi just received a reply, saying that you are trying.
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.
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'
]
;