4 Replies Latest reply on Sep 20, 2014 10:16 AM by Shawn Wallwork

    Bins upon calculated field

    Etay Liberman

      Hi all,

      Thanks a lot for your time!

       

      I have a data set with event level data, which stand for "impressions" of internet ads.

      I know (Boolean) if an impression was clicked or not and of course, much more stuff about each impression (country/site/etc.).

      By using this data I can create CTR (Click Through Rate) calculated field, which is sum(clicks)/sum(impressions), a fraction, of course.

       

      After creating this field, I can't transform it into bins.

       

      In a nutshell, I wish to "group" (bin) the impressions' attribute (on higher levels, like site) by CTR, where I'll be able to divide the CTRs by my choose (for example 0-0.1%, 0.1%-0.5%,>0.5%) and then to display the number of impressions which I had in every bin.

       

      I tried to use this and this, but it didn't help.

      FYI, I'm doing it manually nowadays, when for each attribute I'm filtering and then grouping, but it feels like that there's maybe a better way.

       

      Do you have any other idea?

       

       

      Thanks!

        • 1. Re: Bins upon calculated field
          Catherine Rivier

          Hi,

          I don't really understand what's not working for you in creating bins.  Are you getting an error message in your calculated field?  Are the results not looking the way you want, or are they not calculating correctly?  How are you doing it manually now that's not working for you?  If you can post a sample worksheet and/or some screenshots, that would help a lot.

           

          To add a little help: If it were me - not having your data set on hand, but guessing - I would use a version of your second link, a calculated field for bins:

          http://kb.tableausoftware.com/articles/knowledgebase/creating-variable-sized-bins

          And if the bins needed to change now and then, I would set up two parameters, to set the bin max/mins.  In your example, (0-0.1%, 0.1%-0.5%,>0.5%), I'd have one numeric parameter for the 0.1% value, the other for the 0.5% value, and go from there.  Example:

          IF [CTR]<[Parameter 1] THEN "Bin 1"

          ELSEIF [Parameter 1]<=[CTR] AND [Parameter 2]>=[CTR] then "Bin 2"

          ELSE "Bin 3"

          END

           

          I'll look for more info and try to go from there!

          Catherine

          • 2. Re: Bins upon calculated field
            Sejla Kremic

            I think what Etay is saying is that we cannot create bins of off calculated fields. I am having the same issue and tried the same resources, yet to no avail.

            I had to create a calculated field to get "Score" (which consists of underlying data calcs), which doesnt give me the automatic "Create Bin" option b/c it's a calculated field. When I try to calculate a Bin off of the calculated field, it still doess't work.

             

            To be specific:

            My"Score" Calc is: ifnull(avg([AvgComp]),0)+ ifnull(avg([HolisticGrade]),0)+ avg([Scaled Recommend Instr])

             

            Then I tried to Calculate a bin off of that Score calc:

            if [Score] <= .10 then ".10"
            elseif [Score] <=.2 then '.2'

            ...

            end

            This usually works for Measures to create bins, but not Calculated fields. Does anyone have a suggestion,please?

             

            Thanks in advance,

            Sejla

            • 3. Re: Bins upon calculated field
              laurent.carlier

              Hi,

              I know it is a bit late, but I was looking at similar issue and found a solution.

              Have a look at:

              https://public.tableausoftware.com/profile/lcdatavizu#!/vizhome/ClientSalesTest/Table

               

              Hope it helps.

              Laurent

              • 4. Re: Bins upon calculated field
                Shawn Wallwork

                HA! Yep just a wee bit.

                 

                But thanks for sharing.

                 

                --Shawn