6 Replies Latest reply on Mar 24, 2017 7:25 AM by Shinichiro Murakami

    Getting a continuous line graph

    Tejal Narkar

      Hi,

       

      I am trying to show a measure using a line graph by fiscal week number and month. This is how it looks like when I do not have the month details on the sheet.

       

      After adding the month to the sheet, the line is getting divided into different months as shown below:

       

      is there any way I can have the month details and not break the lines?

       

      I have attached the excel sheet and .twbx file for you to try out.

       

      Thanks,

      Tejal Narkar

        • 1. Re: Getting a continuous line graph
          Christina Davis

          Hi Tejal,

          The issue here is your month column is a text field and then week number is a numeric field. Both dates and numbers can be continuous which is why your week number field produces connected lines. Text fields however cannot be continuous. I don't know of an easy way of fixing this in Tableau; I personally fix this type of issue in the source data. I like to convert my month columns to an actual date by setting the day to the first of the month. You can then pull this date into Tableau and display it as a continuous or discrete date.

          • 2. Re: Getting a continuous line graph
            Tejal Narkar

            Hi Christina,

             

            Thank you for your reply!

             

            I converted the month to date in the tableau and made it continuous. This is the result that I got.

             

            I have attached the workbook for your reference. Is this what you were asking me to do?

            • 3. Re: Getting a continuous line graph
              Christina Davis

              Hi Tejal,

              You're half way there. The issue now is that there is no relationship between your Month and your week number. It looks like the week numbers are based on a fiscal year that starts in October. If this is the case when I would switch your date field to represent your month/week combination using the first day of each week as the date. You can then represent this date by week number in Tableau and then you can do the month / week hierarchy you're looking for.

              • 4. Re: Getting a continuous line graph
                Shinichiro Murakami

                Hi Chrsitina

                 

                I think this is quite tricky in Tableau.

                Two ways I am proposing are both kind of unreasonably troublesome?

                 

                 

                Both case ned to convert week number to continuous to show vertical lines.

                 

                 

                Option - A

                 

                Add reference line by hand individually.

                 

                Change week number to decimal to allow 0.5 ref line.

                 

                 

                 

                You can add 12 reference line one by one.

                0.5,  4.5  9.5 , 13.5  ...........

                 

                 

                Option B

                 

                Combine Line and Gantt to who line-like separator.

                In this case, line plot comes on top of ref line....

                 

                // index()=0 is used for ref line and index()=2 is used for Month text

                [Place for Gantt]

                FLOAT(if index()=1 then

                attr({fixed:max(max({fixed [Week Number]: sum([Current Year Count])}),max({fixed [Week Number]: sum([Current Year Count])}))})+50000

                elseif  index()=2 then 0 end)

                 

                [Place for Gantt (size)]

                -[Place for Gantt]

                 

                [Month text]

                if index()=2 then attr([Month Name]) end

                 

                 

                 

                 

                 

                Thanks,

                Shin

                • 5. Re: Getting a continuous line graph
                  Tejal Narkar

                  Thank you so much, Christina and Shin.

                  • 6. Re: Getting a continuous line graph
                    Shinichiro Murakami

                    Tejal,

                     

                    I'm sorry I mistook a questioner.

                    Anyways, I'm glad if I could help you.

                     

                     

                    Thanks,

                    Shin