Forum Discussion

pantrax's avatar
pantrax
Frequent Visitor
8 years ago

Column sort on date not working as expected

Hello! Trying to get sorting by date to work as i want, but run into a problem. I got a date column with "1.1.2018" etc using this as x axis allows me to drill down from year to daily. Problem is this sorts badly in a column chart giving me jan,nov,des if my data is from 01.11.2017 through 31.01.2018 I did some digging around and made a calculated column (YearMonth) and got that part working, it currently shows 201801,201712 etc as text. If i use this on the x axis i get close to what i'm looking for. I get it sorted in the order of earliest to last month (Yay!). No drill down available, and i get why. But the reason i made this calculated column was cause i read you could set the "date" column to use "YearMonth" with Sort by Column and then it should then sort correctly. Thats not whats happening with me though. Its not interested in changing the sorting from jan,nov,des - am i misunderstanding something? This is all in the same table.

 

 

5 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    That's a bit strange. I have a calendar table and the Date field is set to a data type of Date/Time and all of the sorting works as one would expect. Is your Date column a Date/Time data type in the model?

    • pantrax's avatar
      pantrax
      Frequent Visitor

      Yes it is. I've also tried YearMonth on both text and date.

  • zayan's avatar
    zayan
    Regular Visitor

    Hi pantrax

     

    Did you try chnging the data type in query editor? / or you could use another custom column based on "date" column.

    • pantrax's avatar
      pantrax
      Frequent Visitor

      Dont want to change it from date to another data type. I'm sure it'll just create other problems. I tried making a new custom column and sorting by it but didn't help any.

  • Anonymous's avatar
    Anonymous
    Not applicable

    pantrax,

    I am unable to reproduce your issue, sorting works as expected in column chart, please view my example. Could you please share sample data of your table? And have you sorted your date fields by other columns?



    Regards,
    Lydia