Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to use TimeStamp in key

Hi

All I am facing an issue while creating a key with ID and timestamp

I created the composite key using ID &'_'& floor(LastTimeStamp)  as key

floor(LastTimeStamp)  give  the same result for both the LastTimeStamp i.e.  42537.

Any help ,how we can implement this

load * Inline [

ID,  LastTimeStamp

R1, 16/06/2016 14:13:02

R2,16/06/2016 14:13:28

];

6 Replies
sunny_talwar

May be try this

LOAD *,

  ID & ' - ' & Floor(LastTimeStamp*86400) as Key;

load * Inline [

ID,  LastTimeStamp

R1, 16/06/2016 14:13:02

R2, 16/06/2016 14:13:28

];


Capture.PNG

stabben23
Partner - Master
Partner - Master

Hi,

what format has the other Datefield which you want to "join" With?

If that also is timestamp then dont use floor to get a uniqe key.

Anonymous
Not applicable
Author

Same format

Anonymous
Not applicable
Author

Y u have multiply with this no. What it will do .can u explain

sunny_talwar

I am converting the whole timestamp into seconds by multiplying it by 24 * 60 * 60 and unless there are two timestamps which matches to the last second, you will get a distinct key

PrashantSangle

Hi,

just one query why convert it into floor????

just use. if you want to remove . from it use replace() for it.


1: ID &'_'& num(LastTimeStamp)

or

ID &'_'& replace(num(LastTimeStamp),'.','')

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂