13 Replies Latest reply on Oct 20, 2012 7:56 AM by Alex Kerin

# Why would a reference line value change between a bar and a line graph, all else being equal?

I encountered something very odd today.  I put together a relatively simple chart, utilizing a table calc Window Avg, but when I add a reference line to the chart, the value of the reference line changes depending on whether I use a bar graph or a line graph.  Everything else is identical between the two charts, so I'm at a loss as to why this would change.  The line graph reference line value is the correct one, by the way, but I can't seem to get it to show up using any other chart type other than line.

I've attached a Word doc that shows the relevant screen shots.  Can anyone explain this behavior, and more importantly, help me bypass it?

-Mike

• ###### 1. Re: Why would a reference line value change between a bar and a line graph, all else being equal?

support@tableausoftware....

Looks like a bug to me.

• ###### 2. Re: Why would a reference line value change between a bar and a line graph, all else being equal?

I agree with Alex...and can you post a followup once you hear back from tech support?

• ###### 3. Re: Why would a reference line value change between a bar and a line graph, all else being equal?

It does sound that way.  I've sent an email to support...we'll see what they say.

• ###### 4. Re: Why would a reference line value change between a bar and a line graph, all else being equal?

Not convinced this is a bug... more likely something to do with the way the table calc is being done. What is your formula for Forecast Accuracy (not the window_avg forecast accuracy)?

Look at the line chart, the line is all jagged like it's been overwritten many times for each SKU... although I would expect to see multiple segments in the barchart for each SKU..... unless you've got stacked bars turned off?

• ###### 5. Re: Why would a reference line value change between a bar and a line graph, all else being equal?

Hi Robin,

The formula for Accuracy is:

if sum([AbsErr])>sum([Fcst])

then 1-sum([AbsErr])/sum([Higher])

else (sum([Fcst])-sum([AbsErr]))/sum([Fcst])

end

Literally all I did was change the Mark Type from Bar to Line...nothing else on the chart changed.

-Mike

• ###### 6. Re: Why would a reference line value change between a bar and a line graph, all else being equal?

But he has the partitioning set explicitly, rather than just table down. I wouldn't expect a difference.

• ###### 7. Re: Why would a reference line value change between a bar and a line graph, all else being equal?

I can replicate this in superstore sales and I can see what's going on...

Turn stack marks off, add category to rows, customer to LoD and a window_avg(sum(sales)) to columns. Set compute using customer and add a average reference line in. Switch between line and bars and the average will change between 7058 and 6957

When its on bars, Tableau is calculating the sum of sales divided by the sum of the dcount of customers in each category - i.e. 14.9M / (657+783+704) = 6957

When on line, it is calculating the average of the average of sales in each category i.e.

Furniture 5.1M / 657 = 7882

Office 3.7M / 783 = 4793

Technology 6M / 704 = 8500

...Average of 7882, 4793, 8500 = 7058

So what's going on... bars are calculating an overall average per customer and line is calculating the average of the average per customer in each category.

Bug or by design...not sure!!

• ###### 8. Re: Why would a reference line value change between a bar and a line graph, all else being equal?

Nice analysis Robin.

• ###### 9. Re: Why would a reference line value change between a bar and a line graph, all else being equal?

That certainly is interesting...maybe it'd by design, but if so, it'd be nice to be able to determine which average is used vs. being locked into only one.

I've sent my workbook to Tableau Support, so maybe a definitive answer will emerge soon.

Have a good weekend.

-Mike

• ###### 10. Re: Why would a reference line value change between a bar and a line graph, all else being equal?

I thought I'd have a go at it this weekend and I think you've nailed it, thanks for researching this, Robin! The one other bit is that turning Stack Marks Off isn't even necessary to demonstrate this behavior - the reference line goes to 5,611,462 for the line and 4,971,867 for the bars.

From a selfish user standpoint, I'd still call this a bug, I like my results to not change based no the mark type.

Jonathan

• ###### 11. Re: Why would a reference line value change between a bar and a line graph, all else being equal?

No problem... thanks! Sorry it doesn't help the OP, though!

I too will be interested to hear what the Tableau support jedis have to say about this

• ###### 12. Re: Why would a reference line value change between a bar and a line graph, all else being equal?

A little more info on this: The line, area, and filled map all return the same results, while everything else returns the bar, shape, square, circle, text, gantt bar, and pie marks return the different results.

• ###### 13. Re: Why would a reference line value change between a bar and a line graph, all else being equal?

Intuitively, I feel it shouldn't change...