Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have data as below
Date, SequenceNO
04/30/2014, 1
04/29/2014 , 2
04/28/2014, 3
04/27/2014, 4
............... so on
Now I want to create one more column Bucket to group my Sequence No's.
SequenceNo | Bucket |
---|---|
1-30 | 1 |
30-60 | 2 |
60-90 | 3 |
Date, SequenceNO ,Bucket
04/30/2014, 1 ,1
04/29/2014 , 2 ,1
04/28/2014, 3 ,1
04/27/2014, 4 , 1
............... so on
03/01/2014,31,2
03/02/2014,1,2
thanks in Advance,
Chiru
Try
IF(MOD(SequenceNO,30)<>0,DIV(SequenceNO,30)+1,DIV(SequenceNO,30)) as Bucket
If(Floor(SequenceNO/30) = 0, 1,Floor(SequenceNO/30)) As Bucket
Try
IF(MOD(SequenceNO,30)<>0,DIV(SequenceNO,30)+1,DIV(SequenceNO,30)) as Bucket
Only helpful ? anything missing ?
Thanks Both of you!
You guys rock!