Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
alec1982
Specialist II
Specialist II

Timestamp to number

hi all,

I am trying to load a set of files and then use incremental load to only load new files.

the first step I am trying to take is to load the file modified timestamp and transform it to number then use that number on the incremental load.

the issue is the logic I use doesn't return any number.

Here is my logic. Can someone please help me fix it and thank you in advance.

num(Date(DATE#(filetime(),'MM/DD/YYYY h:mm:ss TT'),'MM/DD/YYYY')) asTimeStampNum

Alec

19 Replies
engishfaque
Specialist III
Specialist III

Dear Alec1982,

This is coming to you due to using Function "Num", Num function is converting your date into numbers.

Just remove your Num function and check your result.

Kind regrads,

Ishfaque Ahmed

alec1982
Specialist II
Specialist II
Author

Ishfaque,

thank you for the help. I do need a number as my end result. my concern is that the number I get is not accurate.. and if you believe it is accurate, do you have any method to test it and confirm.

Thanks again..

tamilarasu
Champion
Champion

Alec,

You can use the below function in textbox to test the result.

=Timestamp('42471,998385064')

The below script working fine in my system. Check the attachment.

Load *,

Num(DATE#(Filetime(),'MM/DD/YYYY h:mm:ss TT'))  as TimeStamp

From Source;

Anonymous
Not applicable

Hi,

Test like this

=Timestamp(42471.998385064)

It gives Date which should match with your date

Anonymous
Not applicable

You can test in Text box

alec1982
Specialist II
Specialist II
Author

well.. it doesn't match. I looked at the file and the time stamp on it shows 3/25/2016 6:02:42 am.



alec1982
Specialist II
Specialist II
Author

this worked for me.. I think I had the remove the extra date#

engishfaque
Specialist III
Specialist III

Dear Alec,

Kindly find attache app.

Kind regards,

Ishfaque Ahmed

Anonymous
Not applicable

Check this in text box

=Timestamp(42454.251875)

Hope it helps!!

tamilarasu
Champion
Champion

Alec, Your first syntax also working fine.   I guess, you forgot to add space between alias name as already mentioned by Anil. Have a look at the attached file.