12 Replies Latest reply on Jul 27, 2016 11:43 AM by Sandy Wolfkind

    2 dates line chart

    Sandy Wolfkind

      I have 2 dates , resolve date and created date .. I need to create a line chart for counting the records by Priority something as below ? how do I structure data for this?

       

      I am pretty new to tableau ,

       

        • 1. Re: 2 dates line chart
          Chris Dickson

          The easiest way to achieve this is to have a row per date and a column each for created and resolved, however your feed is not likely in this format.

          if in a log file  format (where you have a field EventType and another EventDate) then tableau will have no problem creating the above chart

          if in a row per bug format (most likely) where you have a BugID and two fields, one with a created date and another with a resolved date then duplicate the data feed and blend on CreatedDate = ResolvedDate, then you can pull in Numbe rof Records from the primary and Secondary data sources to achieve the above chart.

           

          If you have a safe dataset you can share, im sure myself or someone else in the community could knock you up a workbook to show you how to acheive the above with whatever format data you have.

          • 2. Re: 2 dates line chart
            Sandy Wolfkind

            " then duplicate the data feed and blend on CreatedDate = ResolvedDate, then you can pull in Numbe rof Records from the primary and Secondary data sources to achieve the above chart."

             

            Can you please let me know .. how the above can be done?

             

            do I have to create a calculated dimension ? what would be the expression?

            • 3. Re: 2 dates line chart
              Chris Dickson

              Hi Sandy,

               

              please see attached workbook with same dataset duplicated to create a line on line chart.

               

              to duplicate the dataset right click on the one you have and select 'Duplicate'

               

              then go to the data menu and select edit relationships, once in this dialog you need to select 'custom' and select all the ones Tableau has created automatically and hit 'Remove', now you can choose the Created Date in the left menu and the right menu will filter to only show fields that you can join on, select Resolved Date then 'Add'.

               

              - sub note - When selecting the dates there will be two versions of each date, you want the one without the arrow next to it so that the join is created on the full date value.

               

              Now in your worksheet, drag the created date into the columns and number of records into rows from the original data source, now from the duplicated data source click on the chain link symbol that should be next to the resolved date field (this turns on the join) drag number of records onto the Y axis this should allow you to create a dual axis chart.

               

              Any problems give me a shout.

              1 of 1 people found this helpful
              • 4. Re: 2 dates line chart
                Sandy Wolfkind

                Thank you very much for working on it , but I don't find edit relationship enabled in my version.Attached is my application

                and here is what I am trying to replicate , the Bugs created and Bugs resolved charts are done but I cannot get to create line charts for all priority levels ..

                 

                • 5. Re: 2 dates line chart
                  Chris Dickson

                  Hi Sandy,

                   

                  it looks like you are using Tableau 9.1, so edit relationships should be an option once you have duplicated the datasource.

                   

                  Please see attached workbook.

                  1 of 1 people found this helpful
                  • 6. Re: 2 dates line chart
                    Joe Oppelt

                    To get to "Edit Relationship". click on "DATA" at the top menu strip.  The pull-down will show all your data sources, and below that will be an option for "Edit Relationship".


                    That's where you do that.

                    • 7. Re: 2 dates line chart
                      Sandy Wolfkind

                      Thank you very much Chris and Joe !!

                       

                      How do I show only one axis I don't want dual axis and also how do I differentiate which is resolve Date line and which one is Created date line .. both expressions show Number of Records only

                      • 8. Re: 2 dates line chart
                        Joe Oppelt

                        You can hide one axis.

                         

                        And since you have two lines, you can put MeasureName on the color shelf and get a color legend for the two lines.

                        • 9. Re: 2 dates line chart
                          Sandy Wolfkind

                          How do I hide the axis , if I uncheck the Dual Axis I get the line chart divided into 2 line charts.

                          And also I have the measure names colored .. just not sure which one is for created date and which one is for resolved date , please take a look at the application

                           

                          Thank you!

                          • 10. Re: 2 dates line chart
                            Joe Oppelt

                            Right click on the right-side axis.  Uncheck "Show Header"

                             

                            I'll make a change to the sheet in a minute to rename the two lines.

                            • 11. Re: 2 dates line chart
                              Joe Oppelt

                              See attached.

                               

                              I cleared the right-most axis.


                              I also created actual calcs to do the two SUM(Number of Records), and put them on place of what was on the ROWS shelf.  (You can rename them, accordingly.)

                               

                              I also added those two calcs to the data shelf, and incorporated them into the tooltip.  (Edit the tooltip to reflect the actual names you use when you rename the calcs.)

                              • 12. Re: 2 dates line chart
                                Sandy Wolfkind

                                Thank you very much!!