120 - 240min
240 - 360min
360 - 480min
every interval is 120min block, only 1st block is 15 - 120 min
if( Minutes < 120, Dual('15 - 120 Mins',65),
Dual(floor(Minutes+1,120) & ' - ' & ceil(Minutes,120) & ' Mins', (Ceil(Minutes+1,120)+floor(Minutes,120))/2 ))
LOAD ceil(RAND()*1000)+15 as Minutes
dual('min 15' & ' - ' & End, 15),
dual('min ' & Start & ' - ' & End, Start)
) as TimeInterval;
IterNo() as Min,
Div(IterNo(),120)*120 as Start,
Div(IterNo(),120)*120+120 as End
While IterNo() <= (24*60)
thanks! it works!
You can do like this as well at script level:
IF(Minutes>=15 and Minutes<120, Dual('15-120 Min',1), //Dual() helps you in sorting
IF(Minutes>=120 and Minutes<240, Dual('120-240 Min',2),
IF(Minutes>=240 and Minutes<360, Dual('240-360 Min',3)))) as IntervalFieldName
Hope this will help!!
Re: How to group mins into time interval
please don't post the same question multiple times and close your open threads by selecting correct (and possibly helpful) answers.
Retrieving data ...