4 Replies Latest reply on Jul 30, 2018 1:43 AM by Donna Coles

    Dashboard with several numbers - I would like to use them (divide, multiply ...)

    Frederic Koerckel

      Hello the community !

       

      I have an issue as I am using data that come from different views.

       

      Because data comes from different tables, they are not linked together.

       

      On one hand i have my total revenue. On the other hand, i have my production costs for instance.

       

      How i can obtain my production cost in % of my total revenue for each of my cost center.

       

      When i try to do it it says that i need to build a relationship between my data, but i don't know how to link them.

       

      Thank you for your help,

       

      Matt

        • 1. Re: Dashboard with several numbers - I would like to use them (divide, multiply ...)
          Donna Coles

          Hi there

           

          I've tried to open your workbook, but its asking me to connect to a MySQL connection, so I can't see what you've done. You need to extract your data and embed password.

           

          If you have 2 data sets you want to combine then you will always need to have a common field in both which you can use to link them.  Eg if you have cost centre and revenue in one data set and cost centre and cost in the other, then you can link on cost centre.  If you have date and revenue in one and date and cost in another you can link on date.  If you don't have anything in common between the two data sets, then you can't join them.  This is no different than if the data was in 2 tables in SQL Server, 2 sheets on Excel, 2 tables in Access DB etc etc.

           

          Assuming you do actually have a field in common, then you'l need to use blending to link the data together.

           

          Example

          Data source 1 - Revenue

          Cost Centre Revenue

          A                10000

          B                382900

          C                78989

           

          Data source 2 - Cost

          Cost Centre      Cost

          A                    800

          B                    3370

          C                    7899

           

          Then you can combine data from these 2 data sources onto one view with a blend

          The Cost data source above is the 'secondary' data source as it has an orange icon (blue means primary).  The Cost Centre dimension in the Cost data source has a link icon to show how the 2 data sources are joined.  As both data sources have a field with same name, Tableau automatically adds this link.  If you have dimensions containing the same data but not named the same, you can manually define the relationship vie Data -> Edit Relationships menu

          Once you're happy you've got the 'raw' numbers you want on a single view, you can then create a calculated field in the primary (blue) source (Revenue in this case) for your % Production Cost which will look something like

          As the [Cost] dimension is coming from the secondary data source (called cost), then it is prefixed with the data source reference highlighted.

           

          Packaged workbook in v10.5.3 attached.

          Hope that helps.

           

          Donna

          1 of 1 people found this helpful
          • 2. Re: Dashboard with several numbers - I would like to use them (divide, multiply ...)
            Frederic Koerckel

            Dear Donna,

             

            Thank you for your help,

             

            I figured it out blending my date.

             

            Now i have another issue : if i want to divide my cost that is already filtered by cost center by revenue of this cost center, should i link them also per cost center ?

             

            Thanks,

             

            Matt

            • 3. Re: Dashboard with several numbers - I would like to use them (divide, multiply ...)
              Donna Coles

              Hi

               

              If you have cost center in both data sources, then yes, you should blend on both date & cost center.

               

              If my previous post helped you get what you needed from your original question, then please mark it as correct.

               

              Thanks

              Donna

              • 4. Re: Dashboard with several numbers - I would like to use them (divide, multiply ...)
                Frederic Koerckel

                 

                I would like to have my prod costs in % of my revenue for my group but also for each entity.

                 

                How i can do this ?

                 

                This is printscreen for my dashboard

                • 5. Re: Dashboard with several numbers - I would like to use them (divide, multiply ...)
                  Donna Coles

                  Hi

                   

                  You're going to need to attached a packaged workbook with some sample data if need be, that is set up based on how your data is structured.  What you're asking for sounds achievable (and is what I've already provided in the workbook), but the way your data is structured and what your data contains, may not be as per my assumption.

                   

                  Having packaged workbooks helps to remove all the ambiguities and assumptions that are being made.

                   

                  Please refer to the following article to understand how to create a packaged workbook, and why we ask for it.  A screen shot or explanation of exactly what numbers you're expecting to output based on the example is also useful.

                   

                  Packaged workbooks: when, why, how

                   

                  Regards

                  Donna