Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
mohdhaniff
Creator
Creator

QlikView Timestamp Format

Hi

How to do conversion data known as TriggerDate into Timestamp in Qlik View?

I already try by using below script but no result for Timestamp required

Data:
NoConcatenate
LOAD Distinct * Inline [
Trigger Date
Jul 18 2009 6:08:45:570PM
Jul 18 2009 6:28:48:423PM
Jul 18 2009 6:29:31:456PM
Jul 18 2009 6:30:41:183PM
Jul 18 2009 6:33:15:623PM
Jul 18 2009 6:52:43:853PM
Jul 18 2009 6:53:00:653PM
Jul 18 2009 6:54:46:026PM
Jul 18 2009 10:00:30:806PM
]
;

TimestampTest:
NoConcatenate
LOAD
[Trigger Date],
Timestamp(Timestamp#(left([Trigger Date],20),'MMM DD YYYY HH:MM:SS'),'DD/MM/YYYY HH:MM:SS') as [Timestamp Required] Resident Data;

DROP Tables Data;

 

TriggerDateTimestamp Required
Jul 18 2009  6:08:45:570PM18/07/2009 18:08:45
Jul 18 2009  6:28:48:423PM18/07/2009 18:28:48
Jul 18 2009  6:29:31:456PM18/07/2009 18:29:31
Jul 18 2009  6:30:41:183PM18/07/2009 18:30:41
Jul 18 2009  6:33:15:623PM18/07/2009 18:33:15
Jul 18 2009  6:52:43:853PM18/07/2009 18:52:43
Jul 18 2009  6:53:00:653PM18/07/2009 18:53:00
Jul 18 2009  6:54:46:026PM18/07/2009 18:54:46
Jul 18 2009 10:00:30:806PM18/07/2009 22:00:30
1 Solution

Accepted Solutions
sunny_talwar

Try this

Data:

NoConcatenate

LOAD DISTINCT * INLINE [

    Trigger Date

    Jul 18 2009 6:08:45:570PM

    Jul 18 2009 6:28:48:423PM

    Jul 18 2009 6:29:31:456PM

    Jul 18 2009 6:30:41:183PM

    Jul 18 2009 6:33:15:623PM

    Jul 18 2009 6:52:43:853PM

    Jul 18 2009 6:53:00:653PM

    Jul 18 2009 6:54:46:026PM

    Jul 18 2009 10:00:30:806PM

];


TimestampTest:

NoConcatenate

LOAD [Trigger Date],

Timestamp(Floor(Timestamp#([Trigger Date],'MMM DD YYYY hh:mm:ss:fffTT'), (1/86400)), 'DD/MM/YYYY hh:mm:ss') as [Timestamp Required]

Resident Data;


DROP Tables Data;

Note that Minutes in QlikView is lower case m, rather than upper case M. Upper case M is used for months.

View solution in original post

6 Replies
Anil_Babu_Samineni

Just do this?

Date(Date#([Trigger Date],'MMM DD YYYY hh:mm:ss:fffTT'),'DD/MM/YYYY HH:MM:SS') as [Timestamp Required]

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
sunny_talwar

Try this

Data:

NoConcatenate

LOAD DISTINCT * INLINE [

    Trigger Date

    Jul 18 2009 6:08:45:570PM

    Jul 18 2009 6:28:48:423PM

    Jul 18 2009 6:29:31:456PM

    Jul 18 2009 6:30:41:183PM

    Jul 18 2009 6:33:15:623PM

    Jul 18 2009 6:52:43:853PM

    Jul 18 2009 6:53:00:653PM

    Jul 18 2009 6:54:46:026PM

    Jul 18 2009 10:00:30:806PM

];


TimestampTest:

NoConcatenate

LOAD [Trigger Date],

Timestamp(Floor(Timestamp#([Trigger Date],'MMM DD YYYY hh:mm:ss:fffTT'), (1/86400)), 'DD/MM/YYYY hh:mm:ss') as [Timestamp Required]

Resident Data;


DROP Tables Data;

Note that Minutes in QlikView is lower case m, rather than upper case M. Upper case M is used for months.

View solution in original post

mohdhaniff
Creator
Creator
Author

Hi Sunny,

Thanks for your tips to differentiate between MM and mm..

Regards

mohdhaniff
Creator
Creator
Author

Thanks Anil

ramcena306
Creator
Creator

Hi Sunny,

Can you explain me on this ? (1/86400)

sunny_talwar

To floor to the nearest second... so bascially truncate the micro-seconds