Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

Not applicable

Time format

hi all,

In my application having an filed CDT with datetime format.

Now i needs to have new field only with hours and minutes.

Ex: My CDT with DateTime format will look like below

CDT

01/01/2013 00:00:15

01/01/2013 00:01:00

01/01/2013 00:50:00

01/01/2013 01:01:00

01/01/2013 13:05:00

01/01/2013 23:50:00

Now i want new field only with Hour ans Minutes as below for above example

NewCDT

0

1

101

50

1305

2350

Please can anyone let me know how to do this.

Thanks in advance.

1 Solution

Accepted Solutions
jagannalla
Valued Contributor III

Re: Time format

Try this

     Num(Num#(Text(Timestamp(CDT,'hmm'))))

Hope it helps you..

4 Replies
sreenivas
Contributor III

Re: Time format

PFA

jagannalla
Valued Contributor III

Re: Time format

Try this

     Num(Num#(Text(Timestamp(CDT,'hmm'))))

Hope it helps you..

Not applicable

Re: Time format

hi

try this

A:

LOAD *

INLINE [

    CDT

    01/01/2013 00:00:15

    01/01/2013 00:01:00

    01/01/2013 00:50:00

    01/01/2013 01:01:00

    01/01/2013 13:05:00

    01/01/2013 23:50:00

];

LOAD *, Date(Date#(CDT,'MM/DD/YYYY hh:mm:ss'),'hhmm') as newCDT

Resident A;

then output like this

newCDT
0
1
50
101
1305
2350
Not applicable

Re: Time format

Hi. You can also use

Hour(Date#(CDT,'DD/MM/YYYY hh:mm:ss')) as Hours,

Minute(Date#(CDT,'DD/MM/YYYY hh:mm:ss')) as Minute,

Hour(Date#(CDT,'DD/MM/YYYY hh:mm:ss')) & ':' & minute(Date#(CDT,'DD/MM/YYYY hh:mm:ss')) as HM

Alessandro Furtado

Community Browser