3 Replies Latest reply on Dec 15, 2016 10:55 PM by Shinichiro Murakami

# Week-by-week average on scatter plot

Dear Tableau community

I have been attempting to overlay a week-by-week breakdown of cycle times to get an overview of how the average has varied over the past few weeks onto a scatter plot. So far, I have been able to segment the date range into weeks and implemented this as columns plotted against the cycle time. However, when I attempt to add an average line to each of these weeks the average is clearly wrong.

Note that this is just random data. I suspect I will need to implement a window_avg function of some kind and assign this to a parameter for each week, but I have not been able to get this to work. Any help would be much appreciated!

Cheers,

Kristian

• ###### 1. Re: Week-by-week average on scatter plot

Hi Kristian

You took it too much complicated.

Each pain you created has all the date.

And not-shown date is handled as "null" as still calculated as base of average.

The easier way to accomplish same function is creating calculated filed as week pane.

[Week pane]

if datediff('week',[Date finished],today()) =0

then "1 week ago"

elseif datediff('week',[Date finished],today()) =1

then "2 week ago"

elseif datediff('week',[Date finished],today()) =2

then "3 week ago"

elseif datediff('week',[Date finished],today()) =3

then "4 week ago"

elseif datediff('week',[Date finished],today()) =4

then "5 week ago"

elseif datediff('week',[Date finished],today()) =5

then "6 week ago"

elseif datediff('week',[Date finished],today()) =6

then "7 week ago"

end

Put this field and discrete date on dimension, you can get similar weekly pane.

And then adding average with reference line will bring correct average.

Thanks,

Shin

1 of 1 people found this helpful
• ###### 2. Re: Week-by-week average on scatter plot

Thanks! That works perfectly!

On Fri, Dec 16, 2016 at 4:26 PM, Shinichiro Murakami <

• ###### 3. Re: Week-by-week average on scatter plot

You are welcome and could you mark my answer as correct.

Thanks,

Shin