Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I would like to analyze occupancy percent of a parking lot .
My data include entrance and exit timestamps of cars.
I generated reference timestamps for each hour in the range.
My question is which is the best time resolution (i.e., hour, half an hour..) to analyze the occupancy?
This is due to the fact that the entry and exit times can vary, and I'm not sure how should I round them.
Please consider such cases:
Receipt_EntryDateTime | Receipt_ExitDateTime |
04/03/2016 11:35:00 | 04/03/2016 12:33:00 |
Receipt_EntryDateTime | Receipt_ExitDateTime |
06/04/2016 11:43:00 | 06/04/2016 12:27:00 |
Thanks!
Hi Marco,
I found just a little problem, but I found the solution too 😉
The problem
If you consider only one receiptKey (that start en end in the same day) with a BinSize 00:15 like that, the first bar is not correct :
The reason
It is due to the expression of the calculated dimension :
=Time(Floor(Time,vBinSize),'hh:mm')
The value used as a step by the floor function is not a finite value (00:15 ==> 0.010416666666666666666 ...), but since it is the finite value 0.010416666666667 that is actually used, there is in the end A slight offset that causes the problem found.
The solution
We need to work with minute in this expression :
=Time(Floor(Hour(Time)*60+Minute(Time), Hour(vBinSize)*60+Minute(vBinSize))/24/60,'hh:mm')
Like that the step is a finite value 15 and we have a correct result :
Hi,
yes, due to the limited resolution of the underlying numerical values, time arithmetics may show this behaviour.
Another solution might be:
=Time(Floor(Time,Time#(Time(vBinSize,'hh:mm'),'hh:mm')),'hh:mm')
See also:
Correct Time Arithmetic | Qlikview Cookbook
hope this helps
regards
Marco
Thank you!
You're welcome
Regards
Marco