Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikconsultant
Creator II
Creator II

Two different time formats in one column.

I have a csv-file with 2 different time formats in one column.

24.03.2014 12:57 and

2014-03-24 14:42:05.093

How can I format it in one Format?

1 Solution

Accepted Solutions
maxgro
MVP
MVP

load

  field,

  date(alt(Date#(field,'DD.MM.YYYY hh:mm'), Date#(field,'YYYY-MM-DD hh:mm:ss.fff'))) as newfield

inline [

field

24.03.2014 12:57

2014-03-24 14:42:05.093

];

1.png

the same expression works in a chart

alt(Date#(field,'DD.MM.YYYY hh:mm'), Date#(field,'YYYY-MM-DD hh:mm:ss.fff'))

View solution in original post

7 Replies
shair_abbas
Partner
Partner

In Number tab of properties you can set the data format whatever want...

amit_saini
Master III
Master III

Hi Markus,

Try this:

or follow:

https://community.qlik.com/message/804032#804032

Thanks,
AS

maxgro
MVP
MVP

load

  field,

  date(alt(Date#(field,'DD.MM.YYYY hh:mm'), Date#(field,'YYYY-MM-DD hh:mm:ss.fff'))) as newfield

inline [

field

24.03.2014 12:57

2014-03-24 14:42:05.093

];

1.png

the same expression works in a chart

alt(Date#(field,'DD.MM.YYYY hh:mm'), Date#(field,'YYYY-MM-DD hh:mm:ss.fff'))

View solution in original post

PrashantSangle

Hi,

use ALT()

check in Help menu.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
qlikmsg4u
Specialist
Specialist

If i understand correctly you want to do it while loading? if yes

try this

load

*,

  Timestamp(alt(Date#(Date,'DD.MM.YYYY hh:mm'), Date#(Date,'YYYY-MM-DD hh:mm:ss.fff'))) as DateNew

inline [

Date

24.03.2014 12:57

2014-03-24 14:42:05.093

];

sasiparupudi1
Master III
Master III

LOAD dt,Timestamp(alt(Timestamp#(trim(dt),'DD.MM.YYYY hh:mm'),Timestamp#(trim(dt),'YYYY-MM-DD hh:mm:ss[.fff]'))) as newDT Inline

[

dt

24.03.2014 12:57

2014-03-24 14:42:05.093

];

Kushal_Chawda

create a another field as below

alt(timestamp(timestamp#(Date,'DD.MM.YYYY hh:mm'),'DD/MM/YYYY hh:mm:ss'),

timestamp(timestamp#(Date,'YYYY-MM-DD h:mm:ss[.fff]'),'DD/MM/YYYY hh:mm:ss')) as Date