13 Replies Latest reply: Aug 30, 2013 5:26 AM by Abhinava Chandra RSS

    Sort order with year-month

    Filip Larsson

      Hello everyone,

       

      I have a problem with the sort order in a bar chart. On the x-axis I have a field, let's call it MyYearWeek, which contains the following values:

       

      2013-51

      2014-1

      2014-12

      2014-2

       

      My problem is that I don't know how to sort it correctly, right now with my A->Z sorting the values presents as 2013-51, 2014-1, 2014-12, 2014-2 of course... I really do want to keep the 'YYYY-WW' formatting for my field values. How to sort it within the chart object sort tab, without changing my script below... Perhaps I could use the Year field and Week field seperately for sorting?

       

      My script:

       

      Year(MyDate) As MyYear,

      Week(MyDate) As MyWeek,
      Year(MyDate) & '-' & Week(MyDate) As MyYearWeek

       

       

      Thanks in advance.

       

      Regards,

      Filip