1 Reply Latest reply on Feb 6, 2012 5:59 PM by Dimitri.B

    Proper Average Selection

      We are having an issue using the max function on a chart that is creating daily averages. The max function is selecting a detailed value instead of a max average value.

       

      Please see the attachment for a clear example.

        • 1. Re: Proper Average Selection
          Dimitri.B

          The problem here is that Tableau doesn't know that you want maximum of daily averages, so it calculates maximum of individual values in the raw data. To fix this, you need to use a table calculation that would calculate daily averages and then calculate maximum of those.

          It sounds simple, but it is not. The basic idea is to use something like:

          WINDOW_MAX(AVG([TouchTime]))

          but then, being a table calculation, it needs to be partitioned properly, which requires the Day dimension added to the sheet, which in turn stacks values one over another, so you need to use this instead:

          IIf(LAST()==0,WINDOW_MAX(AVG([TouchTime])),Null)

          which only displays value for the last row of the partition, and that is what I have done here.

          It works for this view, but if you want to use this calculation in a different graph, it may require a more sophisticated approach.

           

          http://public.tableausoftware.com/static/images/Ma/Max_Issuemod/Dashboard1/1.png