Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Timestamp conversions

Here's attached an example qvw that you can run on your machines.

It seems that the Timestamp only suports 17 characters and I need 23.

As how it is now it trims 6 characters (4 from the year, a dash and a month digit), but if I take off the milliseconds from the Date string (which consist in a point and 3 digits=4 characters) it only trims 6-4=2 characters from the Year.

InputTable:

LOAD * INLINE [

  MDate, Contract_ID,Attribute_Name,Attribute_Value_Text

  '2012-05-23 17:21:22.111', ball,color,red

  '2012-05-23 17:21:22.111', ball,diameter,10 cm

  '2012-05-23 17:21:22.111', ball,weight,100 g

  '2014-05-23 17:21:22.111', box,color,black

  '2014-05-23 17:21:22.111', box,height,16 cm

  '2014-05-23 17:21:22.111', box,length,20 cm

  '2014-05-23 17:21:22.111', box,weight,500 g

  '2014-05-23 17:21:22.111', box,width,10 cm

];

/* resulting table (delimiter=tab):

object color diameter weight height length width

ball red 10 cm 100 g

box black 500 g 16 cm 20 cm 10 cm

*/

GenTable:

Generic Load  timestamp(MDate,'YYYY-MM-DD HH:MM:SS.FFF') as SDate, Contract_ID, Attribute_Name, Attribute_Value_Text as AttributeValue Resident InputTable;

ResultTable:

LOAD Distinct timestamp(MDate,'YYYY-MM-DD HH:MM:SS.FFF') as SDate, Contract_ID Resident InputTable;

14 Replies
Not applicable
Author

Michael Solomovich do you have any idea why in your machine you didn't have this problem?

Thanks,

Miguel

Anonymous
Not applicable
Author

No idea.  In fact it is strange how it looks on your machine.  If a numeric field doesn't fit in the cell, it should not be trimmed, it should show ####.

The behavior (trimming) in you screenshot implies that it is text field.  But it behaves as numeric for me.

Not applicable
Author

You think we should scale this to some of the Gods here?

Anonymous
Not applicable
Author

It depends on your life philosophy

I'm OK with the fact that there are things I don't know...

Not applicable
Author

Well I'm not OK if another developer has to go to the same problems I had to... I like to think I can make the world better