4 Replies Latest reply on Mar 8, 2016 9:03 AM by Derrick Li

    Can I create a dynamic data bins which automatically change it's alias

    Derrick Li

      Hello everyone,

       

      I want to toss a question here see if anyone experienced on this. Let's say I have a column with number of days. And I don't know how big it will be in the future. I want to divide it into a certain number of groups with a particular step size like what we have by using bins. The challenge here is I want each group of bins have a customized name like '1-5', '6-10'. As the bin can only automatically generate the name by the value of size. If I use calculation field to code the groups it will be easy but I don't want the last group be showing as 'N+', since I don't know what number will come in in future, if I don't give it as 'N+', the alias or name of the last group has to be changed dynamically based on the max value of days get into tableau, the bins actually does the same thing as whatever number comes in it will be grouped by step size. But the name will not be changing. Is there any way to have this kind of effect which combines auto grouping and renaming together?

       

      Thanks,

       

      Derrick

        • 1. Re: Can I create a dynamic data bins which automatically change it's alias
          KK Molugu

          Derrick Li

           

          I use superstore data set and there may be an option to do this using few calc fields. I am using 5 as your bin size and you can change as needed

           

          //Bin Name Start

          FLOOR((sum([Num Days])-1) / 5) * 5 + 1

           

          // Bin name end

          [bin name] + 5 - 1

           

          // Custom bin name

          str([bin name]) + " - " + str([bin name end])

           

          Let me know if this works..

           

          ..kk

          • 2. Re: Can I create a dynamic data bins which automatically change it's alias
            Derrick Li

            Hi KK,

             

            Thanks for your prompt reply. I can't fully understand this solution and use it. I tried to use the first two calculations to build the start number and end number and concatenate them together by the 3rd one. Then I put it on the column shelf, so it will add all the numbers up and give a step that defined before. I don't know how to separate this trunk into parts. let's say if the I am using number of records as the basic value, and the outcome will be '8396-8400', what I want is it shows from 1 - max(number of records) maybe 500. So if the step is 5, it will show 1-5, 6-10, until 496-500. And I can use it as a dimension to kind of sort the (number of records) or the (days) into groups by sum according to the 1-5, 6-10.... segments. If there are 2 numbers located in 1-5, like 2 and 4, so under 1-5, it will show 6 in total. And suppose the max() value for this days column is 500  right now, and later when I add more data it will auto keep adding the segments by step 5, like 501-505, 506-510. Sorry I didn't explain too clear. And any advice will be appreciated or maybe uploading a sample workbook would be much more helpful due to my poor understanding.

             

            Thanks,

             

            Derrick

            • 3. Re: Can I create a dynamic data bins which automatically change it's alias
              KK Molugu

              Derrick Li

              Can you attach the sample workbook with the data set, so we can help you out

               

              ..kk

              • 4. Re: Can I create a dynamic data bins which automatically change it's alias
                Derrick Li

                Hi, KK. I just uploaded the sample workbook here, please check it when you are available, thanks. So what I need is the presentation like this. Let's say we have a column 'Quantity' and and max value around 12. So I use bins to set up the partition with step 3. And I changed the alias into 0-2, 3-5 instead of 2, 5. I want to it automatically updated according to the values of quantity column's change. if after refreshing the data source, the max value of quantity column is 20, then I want to see the view come with 12-14, 15-17, 18-20. So the problem right now is by using bins. It can auto partition but can't auto rename the alias. if I don't use bins. I can make auto rename by using calculation fields, but I can't do auto partition. P.S. I want to all the values located in each partition can be summed up. It is not like if we have more than 2 values in partition 0-2, then 0-2 will show more than twice. Is there any calculation can mimic the function of bins and combine the rename calculation?