4 Replies Latest reply on Sep 24, 2018 7:07 AM by Rohail Khan

# Averaging a Value from a calculated field

Hi All, The ‘Days Since Previous Date’ is itself a calculated field and uses ‘Update Date’ subtracted from ‘Update Date’ – 1 to give the column. Not sure how to calculate the average days spent in each status. (I have also marked the 'Null' values in 'Days Since Previous Date' to show up as 1)

Any help would be appreciated.

• ###### 1. Re: Averaging a Value from a calculated field

Hi Rohail,

You're going to have to help us out here by providing some data.

Please can you pull something together in Excel with your expected output so we can re-create in Tableau.

Steve

--

• ###### 2. Re: Averaging a Value from a calculated field

Thanks for your quick response, Steve!

Basically I am trying to set up another sheet to give the following: The 'Average # of days in Status' column should take the Initiated --> Requestor Assigned days from each row, total them and calculate the average.

The caveat here is that I have the date field and the 'Days since previous Date' (last column in my original post) is a calculated field with the following formula:

IF(ISNULL(DATEDIFF('day', LOOKUP(MIN([Update Date]),-1), MIN([Update Date])))) THEN 1

ELSE(DATEDIFF('day', LOOKUP(MIN([Update Date]),-1), MIN([Update Date])))

END

Any help would be appreciated. Thanks!

• ###### 3. Re: Averaging a Value from a calculated field

Hi Rohail,

You posting calcs have little to no context as we have no-way of applying them.

As I said, please can you attach an Excel workbook, it doesn't have to be real data, just something where we can see the raw data and then the expected output, this way we can advise on exactly what it is you are wanting.

Steve

• ###### 4. Re: Averaging a Value from a calculated field

Hi Steve. Please see attached file.

Thanks for your time!