5 Replies Latest reply on Nov 18, 2016 1:27 PM by Jaime Fernandez

# Grouping bins greater than 'x'

Hi, I am creating a pie chart based on lag time ( how long between the incident took place and when it was reported) I want to set my bins up by 0-7 days, 7-14, 14-21, 21+

I started by making a bin, then set the bin sizes to 7 and that worked so far. but how do I place all bins greater than 21 days of lag time into one '21+' bin? Any help will be great.

Thanks!

• ###### 1. Re: Grouping bins greater than 'x'

Do you specifically need bins? You might be better with a calculated field like;

IF [Lag Time Days]<=7 then '0-7 days'

ELSEIF [Lag Time Days] <=14 then '8-14 days'

ELSEIF [Lag Time Days] <=21 then '15-21 days'

ELSE '21+ days'

END

• ###### 2. Re: Grouping bins greater than 'x'

I don't know if I'm not setting the field up right, but it just gave me the sum of all the lag time days unfortunately.

• ###### 3. Re: Grouping bins greater than 'x'

Apologies, I believe I got it correct. It worked, thank you!

• ###### 4. Re: Grouping bins greater than 'x'

I have a follow up if you wish to help me.

My lag time dimension uses DATEDIF() of two dates, if one date is null then the calculated field you showed me automatically places it into the 21+ days category, is there a way I can make it omit the null values, when counting the number of records in the 21+ "bin" it throws it off.?

• ###### 5. Re: Grouping bins greater than 'x'

The way I figured out my follow up question was by altering the IF statements you gave me to the following:

IF [Lag Time Days]<=7 then '0-7 days'

ELSEIF [Lag Time Days] <=14 then '8-14 days'

ELSEIF [Lag Time Days] <=21 then '15-21 days'

ELSEIF [Lag Time Days] >21 then '21+ days'

END

Then when I put that into the view, the ones not in the categories have the value 'Null' then I just clicked on exclude. Is this the most efficient way of doing this?

1 of 1 people found this helpful