3 Replies Latest reply on Dec 8, 2016 2:48 PM by Joe Oppelt

    Dividing across data connections

    Tyler Andersen

      I cannot figure this out, but I'm really hoping there is a way to do this. I am needing to find the % of cases to installs for each various scenario (Day 0, Primary Reason X, Secondary Reason Y). The days go from 0-90 with a total of 22,885 rows. Below are the examples.


      I have two different data connections. Both are live SQL connections.

      • The first connection pulls in the number of cases created for a specific primary reason, secondary reason and the day after install. (see below)
        • Age_DaysPrimary_Reason


          Billing QuestionsGeneral200


          CorrespondencesCopy of Contract75
          1Information ChangePayment Method150
          1PaymentTake Payment200
          2Billing QuestionsGeneral350
          2Billing QuestionsPayment Date200
          2AccountLog-In Issues150
          3PaymentTake Payment50
      • The second connection pulls the total number of installs in a given date range. This number will change each time a new install is completed.
        • Total_Installs


      What I need to do is create a calculation that divides the count of each line item in the first connection, by the number (won't be static as it changes hourly/daily) in the second connection.


      Any ideas?

        • 1. Re: Dividing across data connections
          Keshia Rose

          Hi Tyler,


          You can create a calculation like the one below that brings in numbers from both data sources:

          SUM([Count])/SUM([Total Installs].[Total Installs])

          I've attached a workbook that shows this example. With this method you can keep a live connection to the Total Installs number while extracting and refreshing your Cases on a schedule.


          Let me know if this answers your question.


          Take care,


          1 of 1 people found this helpful
          • 2. Re: Dividing across data connections
            Tyler Andersen

            That's great! Do I need to worry about this at all though?


            Screen Shot 2016-12-08 at 3.45.17 PM.png

            • 3. Re: Dividing across data connections
              Joe Oppelt

              The secret to Keshia's example is in NOT having a blend relationship defined between the two data sources.  (You'll notice when you open her workbook that Tableau gives you a warning about that.  Sometimes you need to do that, warning or not!)


              In fact, Tyler, you can even create calcs in that secondary source that key off of parameters (for instance start date and end date) so that you pare down the rows you want to use from there.  SUM([secondary].[calc field]) instead.


              Beautiful stuff that gives you magical powers!

              1 of 1 people found this helpful