Grouping a listview by lookup columns
Hello!I have a list that has two lookup columns. My customers have asked to have this list group items by the two lookup fields. However, when I try to do thatunderfilter/groupsettings inSharePoint designer, the two lookup fields don't show up as an option!Is there a way to group the list items by the two lookup columns?Thanks!-Spaz
October 22nd, 2009 11:25am

Hi Spaz, You can use SharePoint UI to create a new list view by clicking Settings Create View Standard View. Then under Group By you can choose the first lookup column name and the second lookup column name to be grouped. Please let me know if I misunderstood you, thanks. Lu Zou
Free Windows Admin Tool Kit Click here and download it now
October 26th, 2009 3:11am

Hey, Lu!I understand what you mean. The strange thing is - I can filter by the lookups columns, but I can't group by the lookup columns because they aren't listed in the pull-down menu! I can see them in filter, but not in group.Please let me know if there is a setting for me to change.Thanks!-Spaz
October 26th, 2009 1:25pm

Hi Spaz,When you defined the lookup column, do you have the "Allow multiple values" checkbox checked? If so, you will probably not be able to group on that column.Hope this helpsPaul.
Free Windows Admin Tool Kit Click here and download it now
October 26th, 2009 4:13pm

Hi Spaz,When you defined the lookup column, do you have the "Allow multiple values" checkbox checked? If so, you will probably not be able to group on that column.Hope this helpsPaul. +1 You can definitely group by lookup columns but only if they only allow one value. If you allow multiple values, then you can't group whether it's a lookup column or not. However, you can still filter.SharePoint Architect || My Blog
October 26th, 2009 4:22pm

Ah, ok. Now, that could prove problematic for us. We're creating a Shared Document Library for ALL of our work products. Documents may be used on multiple projects and have multiple meta tags, but the users will definitely need to filter, group and sorttheir lists based on these metatag columns that are lookups with multiple options.Any advice on how we can pursue this?Thanks!Tom
Free Windows Admin Tool Kit Click here and download it now
October 27th, 2009 11:18am

You'll need to have multiple columns then - as many as the max # of projects that a doc can be associated with. Each column will have the same dropdown list and be named something like Projects1, Projects2, etc. Same column copied X number of times. That way, if a doc is to be associated with more than one project, then it's a separate piece of metadata for each associated project. Frumpy, but if you do that and only allow one project selection per column, then you can group to your heart's content but only up to 2 layers deep. To go beyond this, you'll need to write some funky code or find a 3rd-party web part or JQuery that can overcome these limitations.SharePoint Architect || My Blog
October 27th, 2009 11:28am

Another option may be to have multiple list view web parts on the page. Each of these web parts would point to a different view where the view was filtered on a specific lookup field, thereby giving a "kind of grouping" effect
Free Windows Admin Tool Kit Click here and download it now
October 27th, 2009 11:35am

Hmmm. I'm not crazy about either of those options, but Paul's suggestion does get me thinking in the right direction - using the interface as a sorting/grouping tool on its own.Clayton's idea would certainly work, but the list of items in the list that the lookup sources will constantly change, and so the need to create and delete columns would have to be figured into the maintenance of the product, and I'm probably going to avoid that.Thanks for all your suggestions, guys! I really appreciate the advice!-Spaz
October 27th, 2009 4:49pm

You wouldn't have to change the columns. You could create a list with the options and then create these columns as lookup columns. That way, whenever the items in the list change, the selectable column data changes. Very little maintenance that way, and it can be done by a non-admin who has Contributor rights on the list. Food for thought...SharePoint Architect || My Blog
Free Windows Admin Tool Kit Click here and download it now
October 27th, 2009 7:00pm

Hi ClaytonHere I'm passing single value in look up columns, but still behaviour of the result is in following format. Here 4 cols are grouping .col1: <a href="https://extranet.joneslanglasalle.com/sites/APClientDemo/Services/AP/sandbox/_layouts/listform.aspx?PageType=4&ListId={4CAFBAAD-0F6D-4DC7-9C7A-EF390222243E}&ID=1&RootFolder=*">portfolio</a> col2: <a href="https://extranet.joneslanglasalle.com/sites/APClientDemo/Services/AP/sandbox/_layouts/listform.aspx?PageType=4&ListId={24CAADF1-BBD8-455E-8073-CD835FAA9886}&ID=1&RootFolder=*">c2</a> col3: <a href="https://extranet.joneslanglasalle.com/sites/APClientDemo/Services/AP/sandbox/_layouts/listform.aspx?PageType=4&ListId={8E54050D-09E4-4447-8BD6-ADF822E130C4}&ID=1&RootFolder=*">c3</a> col4: <a href="https://extranet.joneslanglasalle.com/sites/APClientDemo/Services/AP/sandbox/_layouts/listform.aspx?PageType=4&ListId={A437B2DD-D14A-4ABD-B2D8-9541DB2953A4}&ID=1&RootFolder=*">c4</a>Note:Instead of lookup columns if we use other column(ex: choice,single line..) expected results are comingPlease advice Regards
May 7th, 2012 6:15am

Hi Spaz, You can Grouping a listview by lookup columns with below steps. Open .aspx page in sharepoint desginer.Select Sort/Group from the Ribbon.Add one of the column to the right side panel.Check Group By option and click OK.Save the form with changesNow it will render with content with Groupby Column.Check the CAML query for GroupBy coulmn in .aspx and replace with lookup column.Save the form with new changes. Above steps will work for lookup with multiple values also. Happy Coding!! Regards, N.Srinivas
Free Windows Admin Tool Kit Click here and download it now
May 11th, 2012 1:59pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics