1 Reply Latest reply on Nov 20, 2018 3:02 PM by Paul Wachtler

    Can't compare numerical bin and integer values

    Divya Chhabra

      Hi,

       

      I have a stacked bar chart of bins. The order of the segments in my bar chart is reverse of what I would like it to be. So, I'm trying to create a calculated field so I can sort the bins. However, I'm running into "can't compare numerical bin and integer values"

       

      Here's my calculation

      IF  [Sales (bin)] = 7 then 1

      ELSEIF [Sales (bin)] = 8 then 2

      ELSE 3

      END

       

      Is there another way to sort the bar chart or is there a way to get around this error? I'm not sure how to compare any value to a numerical bin.

        • 1. Re: Can't compare numerical bin and integer values
          Paul Wachtler

          Hi Divya,

           

          I have one idea that may work.  Create a calculated field off of your bin field that's simply:

          - [Sales(bin)]

           

          That will put a negative sign before each value.  Drop that onto your row or columns shelf to the left of your regular [Sales(bin)] field and that should sort the way you want.  You can then right click on the negative field and select "Show Header" to hide it.

           

          Best,

          Paul