Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jgarciaf106
Creator
Creator

Count Missed chats outside Business Hours

Hi Experts,

I need to accomplish the following but I am facing some issues.

1. Start Shift : 06:00:00

2. End Shift: 16:00:00

3. I need to count missed chats, if the chat arrived outside the shifts, should be categorized as OOO, if the chat was missed within business hours should be categorized as Missed chat.

How can I accomplish that?

Thanks in advanced.

7 Replies
wdchristensen
Specialist
Specialist

Maybe try something like the below statement into your load script.


If([ChatMissed] = True, If([ChatTime] >=  [ShiftStart] AND [ChatTime] <=  [ShiftEnd] , ‘Missed Chat’, 'OOO'), ‘Answered Chat’) AS ChatCategory

jgarciaf106
Creator
Creator
Author

Hi I tried that, but by any reason is not working, not sure if that could be related to the ChatTime format, as it comes from a Datetime field.

Thanks,

Anil_Babu_Samineni

First you can generate missing dates and count then using?

Count({<DateField = {"=Sum(Measure)=0"}>} DateField)

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
wdchristensen
Specialist
Specialist

Hi Andres,

Sorry to hear it didn't work as expected. When you say "it is not working" what exactly do you mean? Is the statement always evaluating to false making all the results appear as though all the chats were of type “Answered Chats”?

To find out where the issue resides, I would suggest testing each condition independently and identify which ones are misbehaving. If I was guessing, I would suspect your shift start / end is a date and your actual shift information is stored as a datetime. If that is the case, you need to extract the time portion of the chat for the comparison.

Example of independent condition testing:

If([ChatMissed] = True,’TRUE’,’FALSE’) as BooleanMissedChat,

If([ChatTime] >= [ShiftStart] ,’TRUE’,’FALSE’) as BooleanChatTimeGreaterThanShiftStartTime,

If([ChatTime] <=  [ShiftEnd] , ’TRUE’,’FALSE’) as BooleanChatTimeLessThanShiftEndTime

wdchristensen
Specialist
Specialist

Might try:

https://help.qlik.com/en-US/sense/September2017/Subsystems/Hub/Content/ChartFunctions/GeneralNumeric...


If([ChatMissed] = True, If(frac([ChatTime]) >=  [ShiftStart] AND frac([ChatTime]) <=  [ShiftEnd] , ‘Missed Chat’, 'OOO'), ‘Answered Chat’) AS ChatCategory

jgarciaf106
Creator
Creator
Author

Hi William,

I tested your conditions above, again getting no results, i tried on both  Qlikview and Qlik Sense not results.

I detail I forgot to add, I Set to variables for the time Shift:

SET StartShift = '06:00:00'

SET StartShift = '16:00:00'

My Datetime field, I am using the Time function to extract the Hours portions in 24 hours format.



I am guessing has to any formatting.

jgarciaf106
Creator
Creator
Author

Hi William,

You nailed it, Thanks a Lot.

Regards