may be this
LOAD * Inline [
StartTime , EndTime,Call
If(StartTime >= Peek(StartTime) and StartTime <= Peek(EndTime),RangeSum(Peek(Count),1),1) as Count
Order By StartTime;
Drop Table Temp;
and Max Concurrency = Max(Count)
Thank you for your reply, this is a very interesting line of code, I will break this down so I can understand the logic. In the Interim I got my app working and the outputs look good.
It seems if I can get the same results from your logic then it will be much simpler so I will look into this.
Thanks very much!
Though very memory hungry during the process of creating the table, you could do this with an interval match.
- Figure out how your customer defines "any point in time". Is that once an hour, every minute, every second?
- Generate a helper table that contains those moments.
- Do an interval match between that helper table and your CDRs. Warning: This will create a freakingly huge table if you have a lot of long calls and your customer insists on "every second".
- Now do a count the number of occurrences of every moment.
If your customer wants to be able to slice-and-dice this data, you have to keep this huge table in your data model. But if not, you can save yourself a lot of memory by making a new table with only the moment and the amount that values shows up and drop the huge table.
I hope the above makes sense.