Forum Discussion

mrw2828's avatar
mrw2828
Copper Contributor
Oct 28, 2022
Solved

"Group By" when you have more than one criteria in the column

Hello,

 

I have a list in sharepoint for which I have been asked to build a view that organizes the data by categories stored in one column, but some of the list items fall under more than one category and I would like them to appear in both categories without having to maintain two separate line items in the original sharepoint list. 

 

Here is an example list:

 

VendorProduct Location
Test Vendor1PantsTestlandia
Test Vendor2Pants, JacketsWest Testlandia

 

I'd like to create a view that is grouped by Product with the group categories being 'Product: Pants' and 'Product: Jackets', which would then show Test Vendor1 and Test Vendor2 under 'Product: Pants', and Test Vendor2 under 'Product: Jackets'. Currently, when I group by product it gives me the group categories 'Product: Pants' and 'Product: Pants, Jackets', which is not what I'm looking for. 

 

In other words, I want every vendor that sells Pants to be listed under a 'Product: Pants' group and every vendor that sells Jackets to be listed under a 'Product: Jackets' group, ignoring the fact that some vendors may sell both.

 

Any guidance/advice would be appreciated!

  • mrw2828 you can create multiple Views, each showing something different (pants or jackets or whatever) and then share the link to each View on a page, as for example clickable buttons, tiles, etc. E.g. one button named 'Pants', another named 'Jackets', under a text heading of 'Products'.

     

    Here's a good starting point for creating views:

    https://www.youtube.com/watch?v=8Y3CxqhO78M 

    Note: Whatever you 'Save as", will concatenate to your URL and be the 'name of the view' link you share with your users, so keep it short and succinct (I always abbreviate to reduce total characters), and then after saving, navigate to List/Library Settings, scroll down to where all the views are listed, click on that view you just saved, and then when it opens in the editing page, you can rename ('View Name" field) to make it a friendly name that will appear in the View menu, and also see the direct URL link (Web address of this view, ending in .aspx). Here you can edit the details of the view, too, in the classic experience. Essentially, you are making the URL different to the Friendly name of each view, as the total number of characters in the URL can become problematic down the track, especially when/if item/filenames are lengthy. 

     

    E.g. I might save as "ChinMed" or even "CM", then go back and change the 'View Name' field to "Chinese Medicine", so my URL is shorter by using "ChinMed" or "CM" as the view reference within the URL, but users will instead see "Chinese Medicine" in the View menu. Users don't care what the URL says.

     

    You could save as 'Pants' and then go back and change the 'View Name" field to 'Product: Pants'. Then repeat for Jackets, and however many Products you've got.

     

    Also note the View menu sorts all views alphabetically by name, so bear that in mind when coming up with a naming convention for your Friendly View names. You might want all Products to list above all Vendors, instead of having Products interspersed with Vendors in the View Menu, in which case prefixing all Friendly names with "Product: ..." will sort all the Products above anything prefixed with "Vendor:..." in your View menu. (as P comes before V).

     

    For a decent overview on working with Views:

    https://learn.microsoft.com/en-us/microsoft-365/community/creating-useful-views-in-lists-libraries

     

    If working with larger Lists/Libraries (>5000 items/files), you'll need to consider the view thresholds:

    https://learn.microsoft.com/en-us/microsoft-365/community/large-lists-large-libraries-in-sharepoint

     

     

     

10 Replies

  • maxkari's avatar
    maxkari
    Copper Contributor

    mrw2828  

    Following steps works for me when grouping the second columns.

    Once you have selected the types of groups you required, select show groupings by default as Expanded.

    on your list view, you will first need to collapse all items. This will initially show only 4 items, once all items are loaded you can use expand on the group to see details.

  • Sourceress's avatar
    Sourceress
    Iron Contributor
    mrw2828 I too have struggled with this limitation, and my work around was to split the product column up into several columns with True/False or Yes/No values for each (e.g. Pants column, Jackets column), and group based on their values. Not sure that's a practicable solution though if you have lots of Product categories.
  • mrw2828 This is a known limitation in SharePoint. SharePoint does not fully support grouping on multiple selection columns.

    DocumentationUse grouping to modify a list or library view 


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

    • mrw2828's avatar
      mrw2828
      Copper Contributor
      ganeshsanap thanks for your reply. Are you aware of a different tool that would have this capability?
      • mrw2828 This is not possible using out of the box SharePoint and I am not aware of any 3rd party tool providing similar feature as per your requirements.


        Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Resources