2 Replies Latest reply on Apr 6, 2017 11:39 AM by Rick Maly

    Divide by Two Calculated Fields

    Rick Maly

      Currently I have data for phone calls at our center.  I have two calculated fields already:


      Calls Received: SUM([Calls Taken])

      Employees Taking Calls: SUM(IF [Calls Taken]>0 THEN 1 ELSE 0 END)


      I want to divide the Calls Received by Employees taking calls to get the average calls taken by an employee.


      I have not been able to figure this out.  Any advice?


      Thanks in advance!

        • 1. Re: Divide by Two Calculated Fields
          Walt Reed

          Hi Rick,

          It's a bit difficult to answer your question without seeing how the data is structured. But I assume you've tried a new calculated field: [Calls Received]/[Employees Taking Calls] ?

          I think the issue might be coming from your second calculated field. You need to aggregated [Calls Taken] then return another aggregation.

          For example:

          Employees Taking Calls: IF SUM([Calls Taken]) > 0 THEN COUNTD([Transaction ID]) ELSE 0 END


          From here, you could create your calculated field as specified above.



          • 2. Re: Divide by Two Calculated Fields
            Rick Maly

            Hmmm I was trying it the first way: [Calls Received]/[Employees Taking Calls]


            But I think I figured it out.  It was returning a percentage of 350%.  When I changed that to a number, it calculated correctly.  Only been using Tableau for a month, so still learning. 


            Thanks though, as your response helped pin point my mistake.