Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I need to add to one of my models a counter that will count events in a few time buckets.
in the model i'd like to count closed lines in the system, that was closed in;
last 15 min
last 15 to last 30
30 min to an hour
1-2 hours
the thing is this is a dynamic report and from what i understand the time buckets are fixed hours/days
in a "freestyle " writing i need something like this:
count (ClosedLines) where ClosedLineDate=Today() and ClosedLineTime between Now() and (Now()-2 hours)
Thanks ![]()
Hi All,
thank you for all your replayes!
this is what i've done:
let vTimeNow=time(Now());
let vlasthour=time(now()-1/24);
let vlast2hours=time(now()-2/24);
let vlastQuarterhour=time(now()-15/1440);
let vlastHALFhour=time(now()-30/1440);
let vlast15min=time(now()-15/1440);
ClosedLines:
load
FOLUPInnerNum,
LineClosedDate,
LineClosedTime,
if(LineClosedDate='$(vToday)' and (LineClosedTime>'$(vlast2hours)' and LineClosedTime<'$(vlasthour)'),1,0) as Last2Hours,
if(LineClosedDate='$(vToday)' and (LineClosedTime>'$(vlasthour)' and LineClosedTime<'$(vlastHALFhour)'),1,0) as Last1Hour,
if(LineClosedDate='$(vToday)' and (LineClosedTime>'$(vlastHALFhour)' and LineClosedTime<'$(vlast15min)'),1,0) as Last0.5Hour,
if(LineClosedDate='$(vToday)' and (LineClosedTime>'$(vlast15min)' and LineClosedTime<'$(vTimeNow)'),1,0) as Last15min
it worked fine after the inital load, but once i run it in production, its not loading continuously
any advice?