4 Replies Latest reply on Apr 14, 2014 12:31 PM by Noah Salvaterra

    Problem displaying monthly performance measure

    Jonathon Carrell

      I have a performance measure that looks at the percentage of calls responded to within a timeframe standard.  The timeframe standard is dependant on the call priority so I created a calculated filed to check against the different standards as shown below ...

       

      IF FIRST()==0 THEN

          WINDOW_SUM(SUM(IF (DateDiff('hour',[assign_dt],[starttime])) <= [Emergency Response Target] AND  (STARTSWITH([priority],"1")) THEN 1
              ELSEIF (DateDiff('hour',[assign_dt],[starttime])) <= [Critical Response Target] AND  (STARTSWITH([priority],"2")) THEN 1
              ELSEIF (DateDiff('hour',[assign_dt],[starttime])) <= [Non-Critical Response Target] AND  (STARTSWITH([priority],"3")) THEN 1
              Else 0 END))/COUNT([wo])

      END

       

      This works as expected as long as I filter to all months or a single month (meaning only a single value for percentage is shown).  However, if I attempt to create a line chart by month, it will not show any values and groups them as nulls.

       

      What am I missing here?

       

      Thanks in advance.

        • 1. Re: Problem displaying monthly performance measure
          Shawn Wallwork

          Jonathon, you've created a Table Calculation, which will be affected by any/all dimensions you put in the viz. On top of that, you've created a calculation that only looks at the FIRST() row(column) so Tableau is only going to return one value because that's what you told T you wanted.

           

          Post a packaged workbook with some sample data, and a bit more info on what you are trying to accomplish, and we'll be better able to help you.

           

          Cheers,

           

          --Shawn

           

          Posting a Perfect Question

          1 of 1 people found this helpful
          • 2. Re: Problem displaying monthly performance measure
            Noah Salvaterra

            Looking at your calculation, it was hard to tell what is going on. I suspect that is causing as much trouble for you as it is for us. When I need to make something complex like this, I try to break it into manageable pieces. I see the temptation of dumping things all into one calc, and sometimes it works fine (maybe), but when it doesn't work as expected you're in trouble.

             

            I took a crack at breaking yours down, to see if I could at least figure out your intention. I think I mostly understand.

             

            PriorityNumber:

            Case left([priority],1)

            When "1" then 1

            When "2" then 2

            When "3" then 3

            End

             

            Hours to Start Treatment:

            DateDiff('hour',[assign_dt],[starttime])

             

            Target Met Indicator:

            Case [Priority Number]

            when 1 then (if [Hours to Assign] <= [Emergency Response Target] then 1 else 0 end)

            when 2 then (if [Hours to Assign] <= [Critical Response Target] then 1 else 0 end)

            when 3 then (if [Hours to Assign] <= [Non-Critical Response Target] then 1 else 0 end)

            End

             

            Percentage Meeting Target:

            Sum([Target Met Indicator]))/Sum(1)

             

            This could be shown as a time series, and I think may be what you're looking for (possible the denominator should be count([ow]), though it is hard to say without looking at your data). Window_Sum rolls your data up to a higher level than the full granulatity of the viz, so if this happens across date it wouldn't be very interesting time series to look at as all values would be the same. For this reason there are situations where the result of such a calc are supressed for all but one record, using something like first()==0 or last()==0  is common, the choice of record is typically arbitrary in such cases.

             

            Does that help?

             

            N.

            • 3. Re: Problem displaying monthly performance measure
              Jonathon Carrell

              This appears to be working as intended.  Thank you for the assistance and insight.

              • 4. Re: Problem displaying monthly performance measure
                Noah Salvaterra

                Great! Glad I could help.

                 

                N.