Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Re-ordering the x-axis values

Hi ,

 

I have a table with multiple values for duration, starttime, timestamp etc parsed from a server's log. And I wanted to display a count of projectID and an average of Duration at every hour. SO i extracted day of week and hour from date and time respectively and created a custom column with the following query

Timeline = [WW] & "." & [Day of Week] & "." & [StartHour]. The column is in Text datatype 

 

But when i tried plotting the graph with Timeline as x-axis the order is very different

Please notice how the hour is being sorted by only the first digit.

I went on and added a prefix of 0 to hour but that also didnt change the order.

What i wanted it 40.0.0,40.0.1,40.0.2,40.0.3 etc.

Anyhelp is appreciated. 

  • Anonymous's avatar
    Anonymous
    8 years ago

    Hi, 

     

    TomMartens Thanks for you reply

     

    I sorted it by adding a zero to the last digit that is 40.0.00, 40,0.01.

     

     

    Regards,

    Aish

3 Replies

  • Hey,

     

    the order of values on the x-axis can be changed by defining an index column and using this index column to sort the order of values.

     

    In the picture below I marked the column "Month Name", then I choose "Sort by Column" from the Modeling menu and  selected the column Month No (the index column)

     

     

    By creating the Index column you have to be aware that the value "40.0.0" may occur multiple times in your table, due to the different years. Each occurence must have the same index value.

     

    Hopefully this gets you started

     

    Regards

    Tom

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi, 

       

      TomMartens Thanks for you reply

       

      I sorted it by adding a zero to the last digit that is 40.0.00, 40,0.01.

       

       

      Regards,

      Aish

      • v-ljerr-msft's avatar
        v-ljerr-msft
        Microsoft Employee

        Hi Anonymous,

         

        Great to hear the problem got resolved! Could you accept your reply above as solution to close this thread? :smileyhappy:

         

        Regards