Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ag732312
New Contributor II

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
Contributor III

Re: Count Missed chats outside Business Hours

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

ag732312
New Contributor II

Re: Count Missed chats outside Business Hours

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,

Re: Count Missed chats outside Business Hours

First you can generate missing dates and count then using?

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

wdchristensen
Contributor III

Re: Count Missed chats outside Business Hours

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
Contributor III

Re: Count Missed chats outside Business Hours

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

ag732312
New Contributor II

Re: Count Missed chats outside Business Hours

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.

ag732312
New Contributor II

Re: Count Missed chats outside Business Hours

Hi William,

You nailed it, Thanks a Lot.

Regards

Community Browser