2 Replies Latest reply: May 23, 2014 2:48 PM by Dave Hudnutt RSS

    Line chart - aligning the ordinal number to the x-axis

    Dave Hudnutt

      Say you have Group A and allow the user to select a start and end date for that group.  You also have Group B but you only allow the user to pick a start date and calculate the end date based upon the number of days between Group A.


      For example:

      Group A Start - 1/1/2014 (user selected)

      Group A End - 1/20/2014 (user selected)


      Group B Start - 1/1/2013 (user selected)

      Group B End - 1/20/2013 (calculated)


      So, if you were to make a line chart from this using the date as the dimension and comparing Group A to Group B it would work just fine because you can take off a year in the expression and the dates on the x-axis start at January 1 and they have the same number of days.  Or, use something like Week Number as the dimension.  No problem.


      But say you were to change 'Group B Start' to something off kilter like 3/4/2013.


      Group B Start - 3/4/2013 (user selected)

      Group B End - 3/24/2013 (calculated)


      The calculated 'Group B End' ensures you'll be comparing the same amount of days on the line chart but how do you get 1/1/2014 to line up with 3/4/2013 on the x-axis so you can visually compare the same 20 days?  In other words, I want to align the ordinal number of the result set. 


      1/1/2014 & 3/4/2013 is ordinal 1.

      1/2/2014 & 3/5/2013 is ordinal 2.


      1/20/2014 & 3/24/2013 is ordinal 20.

        • Re: Line chart - aligning the ordinal number to the x-axis
          Elena Prandoni

          Hi David,

          it's a nice question!

          I would like to know which kind of visualization you need on x-axis: in your example, do you have to show dates from 1/1/2014 to 1/20/2014, both ranges of dates or none labels?

            • Re: Line chart - aligning the ordinal number to the x-axis
              Dave Hudnutt

              I confess I hadn't thought that far ahead.  I would be content just having the ordinal day be labeled on the x-axis so it would read something like 1,2,3....20, each representing a day.


              I would also be content with just one set of dates on the x-axis mostly likely those from Group A.


              I guess the holy grail would be to get both the dates on the x-axis but I think that would be rather crowded and hard to read so I'm not terribly hung up on that.  The chart is rather large though so it might work.


              Another interesting visual might be to have the Group A dates at the top of the graph and Group B on the bottom but I don't think that's possible in QlikView (or any other BI software I'm aware of.)