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

Announcements
We are aware of an issue with the Product Downloads page and looking into it.
cancel
Showing results for 
Search instead for 
Did you mean: 
mario-sarkis
Creator II
Creator II

Script

hey all ,

need help and this is my Question :

i have this Field

DateTime

  6/1/2014 6:30:20PM

  6/1/2015 7:30:20AM

10/1/2013 8:30:20PM

   6/1/2015 5:30:20PM

   8/1/2012 6:30:20PM

This an example of a field i have, how can i extract the Date and time separetly in the Script

i used already this >>>>>date(floor(timestamp#(Interaction_Dttm,'M/D/YYYY h:mm:ssTT')))  as Date

But it give me an null Field .

Hope anyone Can help in this

Thank you in advance.

Labels (1)
5 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Date(Floor(Date#(DateTime, 'M/D/YYYY h:mm:ssTT'))) As Date,

Time(Frac(Date#(DateTime, 'M/D/YYYY h:mm:ssTT'))) As Time

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

Have you got leading spaces in DateTime?

Date(Floor(Date#(Trim(DateTime), 'M/D/YYYY h:mm:ssTT'))) As Date,

Time(Frac(Date#(Trim(DateTime), 'M/D/YYYY h:mm:ssTT'))) As Time

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
mario-sarkis
Creator II
Creator II
Author

HI Jonathan

it still give me an empty fields

but when i put ur expression in the list BOX that contain The DateTime

it Give me like this

DateTime

6/1/2014-

  6/1/2015 -

10/1/2013 -

6/1/2015 -

   8/1/2012 -

can you help More ?

MayilVahanan
MVP
MVP

Hi

Try like this

Load DateTime, Date(Floor(Date#(Date, 'M/D/YYYY h:mm:ssTT'))) AS Date, Time(Frac(Date#(Date, 'M/D/YYYY h:mm:ssTT')),'h:mm:ss') AS Time;

Load *, Trim(DateTime) As Date Inline

[

DateTime

  6/1/2014 6:30:20PM

  6/1/2015 7:30:20AM

10/1/2013 8:30:20PM

   6/1/2015 5:30:20PM

   8/1/2012 6:30:20PM

];

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
mario-sarkis
Creator II
Creator II
Author


Hi Mayil Date Time is already a field that i have in my data i didnt understand the INLINE part please can you explain and why in your opinion while using the function that u gave the new field shows empty

Thank you hope you can help