5 Replies Latest reply on Sep 21, 2011 6:21 PM by Taze Young

# Trend lines

Cannot add trend lines. Both axes are numeric. I was able to add trend lines at one point in time, but lost the ability to do that some where along the line. I'm out of ideas. I'm attaching my workbook to the post. An expert user could spot the problem in 10 seconds, I'm sure. I hope some altruistic reader will have a quick look and straighten me out.

• ###### 1. Re: Trend lines

If you want a trend line, both pills need to be continuous. You can tell if a pill is continuous by its color, green means continuous, and blue means discrete. You can change numeric pills between these setting options from the pill's right-click context menu.

In the attached, I made this change and added the trend lines, and edited them so they are polynomial.

• ###### 2. Re: Trend lines

Brilliant. Thank you. Some of the other posts about trend lines in this forum talked about a discrete dimension. I probably misunderstood the posts and then assumed the independent values could be discrete.

• ###### 3. Re: Trend lines

I'm having trouble with this.  I can't provide the workbook as it's linked to a corporate cube but hopefully the screenshots are enough.

First screenshot shows count over time.  Trend lines are added no problem, despite one of the pills being discrete (month).

2nd screen shows similar information, but this time with a table calculation over time.  Tableau refuses to add a trendline.

I have other examples where both pills aren't necessarily green but trend lines can be added - just this one (2.jpg) it refuses to add a trend line.

Any ideas?

• ###### 4. Re: Trend lines

Take a look at the pill on your Columns shelf from both images, on the first, the pill is just "Month", just the dimension, and Tableau can treat dates in this way like it was continuous. In the other image, you have "MY(Month)", Tableau can only treat this as a dimension, and since trend lines require something continuous, trend lines cannot be shown.

One of many options you have is to create a calculated field like:

`DATETRUNC('month',[Month])`

And then when you place the pill on the Columns shelf, set it to "All Values", and then you can have the trend line.

• ###### 5. Re: Trend lines

Genius.  Thanks.