5 Replies Latest reply: Sep 15, 2016 2:38 PM by Sunny Talwar

# Discrete Binning of data.

Hi All,

I am new to this community. I want to create a discrete binning class of data. Ho can I do that.

----------------------------------------------------------------------------------------------------------

Days_Diff   |      Discrete _Binning _Class            Condition

1                |             0 - 1 (AS 0 TO 1)                    if >0 &<=1

2                |                   1 - 2                                   >1 & <=2

3                |                    2 -3

4                |                     3 - 4

5                |

6                |    TILL 10, AND IF ITS > 10, THEN FOR ALL GREATER THAN 10

7                |                    I WANT TO HAVE ">10"

8                |

9                |

11               |

12               |

-1                |

-2                |

-5                |

-7                |

-10              |

-18              |

It will be great help, if anyone let me know, how to do that.

• ###### Re: Discrete Binning of data.

May be using if statement in the script:

If(Days_Diff <= 1, Dual('0-1', 1),

If(Days_Diff <= 2, Dual('1-2', 2),

If(Days_Diff <= 3, Dual('2-3', 3),

If(Days_Diff <= 4, Dual('3-4', 4),

If(Days_Diff <= 5, Dual('4-5', 5),

If(Days_Diff <= 6, Dual('5-6', 6),

If(Days_Diff <= 7, Dual('6-7', 7),

If(Days_Diff <= 8, Dual('7-8', 8),

If(Days_Diff <= 9, Dual('8-9', 9),

If(Days_Diff <= 10, Dual('9-10', 10), Dual('>10', 11))))))))))) as Buckets

FROM....

• ###### Re: Discrete Binning of data.

Thanks Man