4 Replies Latest reply on Apr 3, 2017 9:54 AM by Shinichiro Murakami

# Making a poor man's trend line, w/o table calculations or trend (10.2)

I would like to visually display a trend line as well as use Tableau's Forecast feature.

However, the tool tip that is displayed by Tableau's trend line can not be modified or removed so it would create more confusion for my intended audience. I can not use Tableau's trend line feature.

In that vein I would like to create a poor man's trend line by calculating the slope between the first and last point in a timeseries and runnign a line through it. Because I am using forecasting I can not use table calculations, I believe. Accuracy (in terms of linear regression) is less important here.

I've attached a work book with my failed attempt, wherein I tried to use LOD to take only the first and end of the timeseries and fix a value on those two points. If that was successful I was going to convert to a line (or area) mark. The LOD expression was `{FIXED MIN([Order Date]), MAX([Order Date]): [Profit]}` but that includes double aggregations...

• ###### 1. Re: Making a poor man's trend line, w/o table calculations or trend (10.2)

Hi Kwame

Could you illustrate what was wrong in your case?

or you simply need start and end point.

[SM My Calculated Trend Line ]

if attr(DATETRUNC('month', [Order Date]))=attr({FIXED :min(DATETRUNC('month', [Order Date]))})

or attr(DATETRUNC('month', [Order Date]))=attr({FIXED :Max(DATETRUNC('month', [Order Date]))})

then sum([Profit]) end

Thanks,

Shin

• ###### 2. Re: Making a poor man's trend line, w/o table calculations or trend (10.2)

Shin - Thanks, I simply needed the start and end point. This looks like almost the solution for me except that I need the min/max date per year. This way I can draw a trend line per pane/year in Sheet 21.

• ###### 3. Re: Making a poor man's trend line, w/o table calculations or trend (10.2)

Shinichi Mikami I realized that adding in YEAR([Order Date]) to the Fixed LOD would give what I was looking for. Thank you for your quick response!

• ###### 4. Re: Making a poor man's trend line, w/o table calculations or trend (10.2)

Kwame,

Some modifications are needed.

[SM My Calculated Trend Line ]

if attr(DATETRUNC('month', [Order Date]))=attr({FIXED DATEPART('year', [Order Date]) :min(DATETRUNC('month', [Order Date]))})

or attr(DATETRUNC('month', [Order Date]))=attr({FIXED DATEPART('year', [Order Date]):Max(DATETRUNC('month', [Order Date]))})

then sum([Profit]) end

Because new trend line requires continuous axis, add "Continuous" Month axis under "Discrete" Year dimension.

Thanks,

Shin