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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Time and day of the week

Hi

5/17/2007 5:32:39 PM

I have above date stored in my data table. I want to extract the following from the date

Hour,

Minute

Week Day (Sunday,Monday etc...)

How can I write the syntax please

1 Solution

Accepted Solutions
MarcoWedel

If your date field contains text, then try like:


Hour(Timestamp#(yourdatefield, 'M/DD/YYYY h:mm:ss TT')) as Hour,

Minute(Timestamp#(yourdatefield, 'M/DD/YYYY h:mm:ss TT')) as Minute,

WeekDay(Timestamp#(yourdatefield, 'M/DD/YYYY h:mm:ss TT')) as WeekDay



If your date field contains real timestamp values, then try like:

Hour(yourdatefield) as Hour,

Minute(yourdatefield) as Minute,

WeekDay(yourdatefield) as WeekDay,



hope this helps


regards


Marco

View solution in original post

4 Replies
MarcoWedel

If your date field contains text, then try like:


Hour(Timestamp#(yourdatefield, 'M/DD/YYYY h:mm:ss TT')) as Hour,

Minute(Timestamp#(yourdatefield, 'M/DD/YYYY h:mm:ss TT')) as Minute,

WeekDay(Timestamp#(yourdatefield, 'M/DD/YYYY h:mm:ss TT')) as WeekDay



If your date field contains real timestamp values, then try like:

Hour(yourdatefield) as Hour,

Minute(yourdatefield) as Minute,

WeekDay(yourdatefield) as WeekDay,



hope this helps


regards


Marco

upaliwije
Creator II
Creator II
Author

Thanks Marco

I have written as follows. But it is not working

Pls help

Hour(Timestamp#('LOSS_DATE', 'M/DD/YYYY h:mm:ss TT')) as LOSS_HOUR,

       WeekDay(Timestamp#('LOSS_DATE', 'M/DD/YYYY h:mm:ss TT')) as LOSS_DAY,

PrashantSangle

Hi,

Use

Hour(dateField) as Hour

Minute(dateField) as Minute

WeekDay(DateField) as WeekDay

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
PrashantSangle

Hi,

Since LOSS_DATE is FieldName remove ' before and after fieldName

Hour(Timestamp#(LOSS_DATE, 'M/DD/YYYY h:mm:ss TT')) as LOSS_HOUR,

WeekDay(Timestamp#(LOSS_DATE, 'M/DD/YYYY h:mm:ss TT')) as LOSS_DAY,

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂