Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Eg.
120 - 240min
240 - 360min
360 - 480min
every interval is 120min block, only 1st block is 15 - 120 min
Maybe like
LOAD *,
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 ))
as Class;
LOAD ceil(RAND()*1000)+15 as Minutes
AutoGenerate 11000;
load
Min,
if(Start=0,
dual('min 15' & ' - ' & End, 15),
dual('min ' & Start & ' - ' & End, Start)
) as TimeInterval;
load
IterNo() as Min,
Div(IterNo(),120)*120 as Start,
Div(IterNo(),120)*120+120 as End
AutoGenerate 1
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!!
see also
Re: How to group mins into time interval
please don't post the How to group mins into time interval multiple times and close your open threads by selecting correct (and possibly helpful) answers.
thank you
regards
Marco