5 Replies Latest reply on Aug 7, 2012 4:34 AM by Lin Gan

    How to add Trend Line

    Lin Gan

      Hi, i am new to Tableau and I have been trying  to add a trend line for the weekly performance of our publisher, i created a new filed named "Weeks" by using DATETRUNC Function but still not working, can anyone help me this out?

       

      I already attached the row data and the worksheet i did.

        • 1. Re: How to add Trend Line
          Shawn Wallwork

          Hi Lin,

           

          You'll make it easier on us if you post a 'packaged' workbook (twbx). Thanks,

           

          --Shawn

          • 2. Re: How to add Trend Line
            Lin Gan

            Hi Shawn,

             

            Thank you for the prompt reply, a "packaged" workbook is attached.

             

            BTW, what's the difference between "twbx" and "twb" ?

             

            Thanks again.

             

            Lin

            • 3. Re: How to add Trend Line
              Shawn Wallwork

              Lin,

               

              I'll take a look. twbx is the extension Tableau uses for their packaged workbooks, which is really just a zip files with all the elements (data, image, shapes, etc.) that make up your viz. The twb only includes the Tableau workbook, none of the data, so it won't work properly.

               

              --Shawn

              • 4. Re: How to add Trend Line
                Shawn Wallwork

                Lin, thanks for this question. I'd been meaning to play around with trend lines and just never got around to it. I've attached your workbook with a trend line included. It turns out that both axis have to be number values, not strings. The confusion comes when dealing with dates because in some formats they are stored as string, in others they are stored as number values. When you use MDY you get a string, so trend lines aren't available. By changing your data to 'Exact' it changes it into a number value and trend lines are available.

                 

                MDY.PNG EXACT.PNG

                 

                --Shawn

                • 5. Re: How to add Trend Line
                  Lin Gan

                  Hi Shawn,

                   

                  The trend line does show up when choosing exact date, but if you take a closer look you would notice the date in Y axis has been changed.

                   

                  In the raw data, our weekly range is Sunday - Saturday, for instance, 6/11 - 12/11, since you choose the exact date, it just make the week exactly the same as the week in calendar.

                   

                  So, is there a way we can keep original date without changing it.

                   

                  Thanks a  lot.

                   

                  Lin