2 Replies Latest reply on Aug 21, 2018 1:19 PM by Ashley Inman

# Histogram Sort and Negative Numbers

I have a histogram that I've created with the help of some of the histogram discussions. But I'm running into a sorting issue with negative numbers.

It is not sorting the x axis numbers in order correctly. And because I've given users the ability to change the bin size and groupings I don't think the custom sort will work?

I'm also wondering why in my bin sizing why when I have a "Group Everything Below" set at -125 currently why the -120 bin is still showing? I've looked at my formulas and can't see what is causing this?

• ###### 1. Re: Histogram Sort and Negative Numbers

It's hard to say what's causing the sort order issue without being able to see how you've created the bins. Perhaps if you give us a bit more info around this we can help. As for the -120, I would expect this to show, as you have grouped everything below -125, and -120 > -125.

• ###### 2. Re: Histogram Sort and Negative Numbers

Weird even when I put in -110 it also is still showing the -120 bin.

Unfortunately I'm unable to share my workbook but below are the formulas I'm using.

MEASURE

INT( [Days Late] / [Bin Size] ) * [Bin Size] - IF [Days Late] < 0 THEN [Bin Size] ELSE 0 END

DIMENSION

if [Fields to Group Above] THEN STR([Group Everything Above])+ ' to ' + STR({fixed      : MAX([Computed Bin]) } )

ELSEIF [Fields to Group Below] THEN STR([Group Everything Below]) + ' to ' + STR({fixed      : MIN([Computed Bin]) } )

else STR([Computed Bin]) END

PARAMETERS

SETS