11 Replies Latest reply on Oct 9, 2015 1:47 AM by Niko Suomi

    Percentage from total value

    Niko Suomi

      Hello.

       

      I have a really big problem on my hand at the moment.

      For some reason, Tableau can't calculate correctly my percentage difference on graphics.

       

      For example I have dimension values A and B.

      These have values 5 and 10.

       

      So, then A should be 5/15= 33,3% and B 10/15=66,6%

       

      For some reason when filtering with dimensions, the percentage does not work correctly or the dimension values are not all shown.

       

      I am trying to use (([Volume])/WINDOW_SUM(([Volume])))*100

      and also before that window_sum I used Total ...

       

      Nothing seems to work.

        • 1. Re: Percentage from total value
          Chale Dodge

          that probably has to do with the Table Calculation

           

          Do you have a sample workbook you can share?

          • 2. Re: Percentage from total value
            Sankarmagesh Rajan

            hi

             

            If we use the calc as

            sum([Package])/WINDOW_SUM(sum([Package] ))*100

             

            this will give % in both category, if we select one category only then this will show 100%.

            Please attach workbook.

             

            Thanks

            sankar

            • 3. Re: Percentage from total value
              Alfredo Pirrone

              Hi Niko

               

              Not sure if I understood your question, but I will try to answer.

               

              If you try to use a table calculation formula in a calculated field you need to use aggregate fields. Therefore your formula should look like:

                  ( sum([Volume]) / WINDOW_SUM(sum([Volume])) )*100

               

              If you just want a % of total based on some measure, I suggest you just do that directly on the table:  pick a value from the column showing the absolute values, then select Analysis -> Percentage of -> Column. The absolute values will become relative values (percentages)

               

              If you want to keep the absolute value and add an additional column with the percentage, then you could  duplicate the measure, add both to the table, and make one of these columns become your "percentage of"  column.

               

              Hope this helps.

              Yours,

              Alfredo

              • 4. Re: Percentage from total value
                Niko Suomi

                Yes, it does that.

                 

                But when filtering with dimensions like Store or Substore, it does not show correctly the data.

                Unless I put the dimensions Store and Substore to for example Tooltip shelf.

                 

                I can't attach workbook from this, it is NDA-under work :/

                 

                Thank you for your input

                 

                 

                 

                - Niko

                • 5. Re: Percentage from total value
                  Chale Dodge

                  Hi Niko,

                   

                  Can you follow this guide please for us to help you:

                  Anonymize your Tableau Package Data for Sharing

                  http://community.tableau.com/docs/DOC-6271

                   

                  Seems like you are almost at your solution.

                   

                  Regards

                  Chale

                  • 6. Re: Percentage from total value
                    Niko Suomi

                    This is really odd.. I think Tableau populates the data really strange way for some reason on my workbook.

                     

                    I use certain dimensions to filter data and I have to add some dimensions and metrics to tooltip shelf to make the chart to work. For some reason when I select some dimension from quickfilter, it shows Null value and then with two value it shows the right values..

                     

                    And sometimes I select any values and it works correctly, but when I select (All) again, it shows only Null.

                     

                    How is this possible? Do I have too many rows of data or something?

                     

                    How does the Tableau data population work with quickfilters.. And the quickfilters also filter eachother.

                    • 7. Re: Percentage from total value
                      Niko Suomi

                      Thank you for the links, but it is too risky to upload outside of the organization. Sensitive data and so on ..

                      • 8. Re: Percentage from total value
                        Alfredo Pirrone

                        Niko:

                         

                        Do not get desperate with your issue. Filters are very powerful and flexible tools and it is easy to have something wrong.

                        In this community there are hundreds of people willing to help you. I am one of them.

                        But you need to give us that chance. I understand the sensitivity of your data but I suggest you try to reproduce the odd behavior with test data.

                        Sometimes, when you work out a simplified test trying to isolate the issue, you see the answer to your question without needing further assistance.

                        In the mean time, I do not believe volume of records is an issue for Tableau. It is designed to work with very large number of records.

                        Filters may affect one another. Maybe this will help in your case:

                        Cascading Quick Filters in Tableau - The Information Lab

                         

                        I look forward to here from you.

                        Good luck

                        Alfredo

                        • 9. Re: Percentage from total value
                          Niko Suomi

                          Thank you for your answer, I will take a look on that article that you linked

                           

                          I think I have read that earlier, but maybe it could be good to refresh my memory.

                          • 10. Re: Percentage from total value
                            Niko Suomi

                            Today I got a following error message when using filters:

                            Error in parameters for command 'categorical-filter' missing: visual-id-pres-model

                             

                            After that, it just worked "normally".

                             

                            I also applied these changes on my filters (The power of 3):

                            http://www.theinformationlab.co.uk/2013/08/12/cascading-quick-filters-in-tableau/

                             

                            No help yet from that..

                             

                            Volumes seems to be ok for time to time, but when I change to median, then the numbers does not add up again.

                            I have o time series, also there, and that is the only chart that works correctly all the time.

                            • 11. Re: Percentage from total value
                              Niko Suomi

                              I have maybe solved this problem and I think it has something to do with my time filters.. Or not.

                              Only time will tell (no pun intended).

                               

                              But now when I want this new solution to work with my pie chart, it is almost impossible.

                              When I filter the last values via Time, then I of course get two time values. The C has only occured on time period C.

                               

                              But if i but the A\B\C dimension to columns, it only shows the last time, in this case 8/15.

                              And what I would like to see, would only be the 8/15 but without that dimension on columns shelf, 'cause it causes the piechart to go in dimension pies A and B. After that there is only two 100% pies.

                               

                              tackle.png

                               

                               

                               

                              Niko