Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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.

Thanks in advance ....

5 Replies
sunny_talwar

May be using if statement in the script:

LOAD Days_Diff,

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....

Not applicable
Author

Thanks Man

MarcoWedel

maybe helpful:

Custom Filter(unusual range)

regards

Marco

Not applicable
Author

Thank you very much, both the solution are working good

sunny_talwar

Please close the thread if you now have got what you wanted by marking correct and helpful responses.

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny