2 Replies Latest reply on Jul 8, 2016 4:14 PM by Ashwin Chandak

# Discrete Fixed Calculation Not Averaging Correctly

Hello guys,

Please find attached a dummy data file in excel and a tableau workbook to demonstrate the issue I am encountering.

I am trying to create a view to show average metric values for a chosen date ranged (based on a date parameters) and a spark line/ trend line for the corresponding date range.

The aggregated number should be an average of all the data points on the sparkline

For this, I have set up a calculated field called 'Fixed Value' with the following formula : { FIXED [Metric]: AVG([Param Value])}, and converted it to discrete.

The issue is that the average of the sparkline is not being correctly calculated for the fixed calculation

Is there something I am missing or is there a workaround to achieve the same?

Please find the workbook attached. Kindly let me know. Thanks!

-Ash

• ###### 1. Re: Discrete Fixed Calculation Not Averaging Correctly

Ashwin,

I think you might need to split it up into two parts.

I created a [ParamAvg]:

{FIXED [Metric],[Date]:AVG([Param Value])}

which produced the average for the metric for each day.

Then I averaged those values:

{ FIXED [Metric]: AVG([ParamAvg])}

The original {FIXED [Metric]:AVG([Param Value])}

was averaging all the points regardless of dates,

but this other version averages the averages at particular dates.

If each date had the same number of measurements,

then I think the results would be the same.

There seems to be a lot of general discussion about

taking averages of averages.

• ###### 2. Re: Discrete Fixed Calculation Not Averaging Correctly

This approach worked, Thanks!