Forum Discussion

Deleted's avatar
Deleted
Feb 20, 2019

Sharepoint library - how to sort document by multiple columns

I have a SharePoint library with multiple columns/metadata - year, month,.

I would like to create a view where my documents are sorted by year, and then by month (placing the most relevant files in the top). I can't used modified or created date, since some of these documents are not necessarily created or modified in chronological order.

If I sort by month, I get January first, but then the year is all scrambled, and if I sort by year the months are not in order. How do I do that?

  • How are your month columns? Are they just text fields? If so you're going to have to use a calculated column and either try seeing if you can use a function to convert text to date value and sort on that so it will sort in date order, or you'll have to use a bunch of IF statements to assign a value to the month names then sort by that column.
    • Deleted's avatar
      Deleted

      Both the year and month columns are text fields but the data in there is values. So, 01 for January etc.

      I can sort newest to oldest by sorting Z to A. But I can only sort by one column at a time.

      • If you edit the view and go into the old classic setting page, you there is a sort section there, where you can sort by more than one column, you set one then the next etc.
  • Hi Deleted,

     

    Is this what you want to achieve?

    Grouping by Year and then grouping by Month# is how I went about this. 

    I don't think there is a way to alias the month number with a month name value but it would good if you could.

     

    I hope this helps.

     

    Norm

Resources