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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hour of the Day problem

Hi

I have in the qvw, attached, there is a column called "Incident Time". I have a problem of calculating "Hour of the Day" these incidences happened from "Incident Time".

I want to get a chart ["No. of Incidents" - count(surname) VS "Hour of The Day"].

appreciate if you could help.

Thanks

Flavian

5 Replies
anbu1984
Master III
Master III

Attachment is missing in your post

Not applicable
Author

Sorry it is attached now. Flavian

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this in script

Data:

LOAD Service,

     [Ward/Location],

     [Incident Date],

     ID,

     Gender,

     SAC,

     [Incident Type],

     [First Name],

     Surname,

     [Incident Time],

     [Type of Incident],

     Hour(Timestamp#([Incident Time], 'hh:mm')) AS HourOfTheDay,

     Harm

FROM

(biff, embedded labels, table is Sheet1$);

Hope this helps you.

Regards,

Jagan.

aveeeeeee7en
Specialist III
Specialist III

Hi

You can also use Interval# function like this:

Hour(Interval#([Incident Time],'hh:mm'))

Use the above in your backend Script in the same way Jagan Sir explained.

Regards

Av7eN

Not applicable
Author

Hi

Thanks very much.

In case if we have the “ Incident date” like 10th December 2014, please let me know the expression to calculate “Day of the Week” for all incident dates.

Thanks

Flavian De Silva