Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to determine when a calculated duration is less than or equal to 30 minutes as a measure.
I tried using the following:
Count({$<(InRoomTm-ArrWaitTm)*1440)={"<=$(=30)"}>}(InRoomTm-ArrWaitTm)*1440))
but there is an error, with no output
&
Count(if(((PtInRoomTm-PtArrWaitTm)*1440) <=30, 1)) / count(all ((PtInRoomTm-PtArrWaitTm)*1440))
but the output is incorrect
Does anyone have a solution/fix to this?
Do you want to do a count here or Sum?? May be try something like this
Sum({$<UniqueIdentifierField = {"=(InRoomTm-ArrWaitTm)*1440) <= 30"}>} (InRoomTm-ArrWaitTm)*1440)
Thank you @Sunny T! I believe its closer, but I'm still not getting the correct output.
I've put in:
Sum({$<VisitNum = {"=(InRoomTm-ArrWaitTm)*1440) <= 30"}>} ((InRoomTm-ArrWaitTm)*1440))
But I'm getting an error message of "Bad field name: InRoomTm, ArrWaitTm" for the second instance of "...(InRoomTm-ArrWaitTm)*1440) "
Any thoughts? Not sure why it's not reading it since the expression is correctly formatted.
Seems like we left one extra parenthesis in the expression:
Sum({$<VisitNum = {"=(InRoomTm-ArrWaitTm)*1440) <= 30"}>} ((InRoomTm-ArrWaitTm)*1440))
Try this:
Sum({$<VisitNum = {"=(InRoomTm-ArrWaitTm)*1440 <= 30"}>} ((InRoomTm-ArrWaitTm)*1440))
It's still not reading that second instance of the calculation:
What exactly is InRoomTm and ArrWaitTm? Are these field names or are they variables
They are field names populated with times.
Would you be able to share a sample to take a look at the issue?
Let me know if this helps:
VisitNum | SchedDT | ArrWaitTm | InRoomTm |
1 | 1/1/2017 | 7:22 | 7:30 |
2 | 2/1/2017 | 8:09 | 8:15 |
3 | 12/1/2016 | 8:06 | 8:50 |
I want to know both the count of how many visits had a wait time of 30 mins or less from arrival time (ArrWaitTm) to time seen (InRoomTm) & what that count is as a percentage of total number of visits.
Two methods
1)
=Sum({<Flag = {1}>}(InRoomTm - ArrWaitTm) * 1440)
2)
Sum({<VisitNum = {"=InRoomTm-ArrWaitTm <= MakeTime(0, 30)"}>}(InRoomTm - ArrWaitTm) * 1440)
For method one, I have created a flag in the script:
Table:
LOAD *,
If(InRoomTm - ArrWaitTm <= MakeTime(0, 30), 1, 0) as Flag;
LOAD * INLINE [
VisitNum, SchedDT, ArrWaitTm, InRoomTm
1, 1/1/2017, 7:22, 7:30
2, 2/1/2017, 8:09, 8:15
3, 12/1/2016, 8:06, 8:50
];