The reason is simple: the initial display of the list view is smaller, and the user controls what to display by clicking a Plus/Minus button to expand/collapse a specific group of data. Generally speaking on the Web, the less data displayed, the faster it displays. Furthermore, clicking the Plus/Minus button does not refresh the entire page; it only loads the subset of data that is needed onto the current page.
The grouping part is straightforward. Create a view, edit the view, and then change this section of the Edit View form, which is fairly self-explanatory.
Here's what each additional view -- with one group level expanded -- looks like.
The "By Last Name" view
The "By Birth Month" view
The "By Service Level" view
Finally, here's how each view was defined in the Edit View form.
View | Columns and Order | Sort | Group By | Totals |
All Items | Badge Last Name (Edit) First Name Hire Date DOB Begins With DOB Month Years Seniority | Ascending Badge | NA | Count of Badge |
By Last Name | Last Name (Edit) First Name Hire Date DOB Years Seniority | Ascending Last Name Ascending First Name | Begins With Collapsed 100 items per page
| NA |
By Birth Month | Last Name (Edit) First Name Hire Date DOB Years | NA | DOB Month Collapsed 100 items per page
| NA |
By Service Level | Last Name (Edit) First Name Hire Date Years | Descending Years Ascending Last Name | Seniority Collapsed 300 items per page | NA |
As you can see, the Group By feature requires a list column to create and sort the group. Sometimes you already have a list column you can use, like a Department or Job Title. Other times, you need to create a calculated column to effectively group the data. That's where the fun comes in.
Let's take a look at a common scenario in any enterprise – viewing a subset of employee data. In this case, we have a list that contains employee data pertaining to hire dates, date-of-birth, and seniority level.
Each week, all the data is replaced with a new set of data from a master database -- containing new, updated, and deleted employees. A simple way to do this is to use Office Access 2007 to link to the list, and then each week, run a macro that deletes all the old data, and then appends the new data to the list.
The most common user requests for this set of data are easy ways to find:
· Employee longevity information by last name.
· The month an employee was born, so birthday celebrations won't be forgotten.
· An employee's seniority level (5, 10, 15, and 20), so award ceremonies can be planned in advance.
To satisfy each requirement, let's create three views of the list that group the data appropriately based on calculated columns.
Here's what the All Items Employee Birthdays/Seniority list view, which contains over 1000 items, looks like.
Here's a summary of the list metadata including the formulas used with the calculated fields.
Field | Type | Description | Formula | Example |
Badge | Text | The Employee's badge number. | NA | 44819 |
Last Name | Text | The employee's surname. | NA | Bacon |
First Name | Text | The employee's given name. | NA | Dan |
Hire Date | Date/Time | When the employee was officially hired. | NA | 9/25/1996 |
DOB | Date/Time | When the employee was born. | NA | 6/28/1953 |
Begins With | Calculated Text | Calculates and displays the first letter of the last name for use with the view that groups names in alphabetical order. | =LEFT([Last Name],1) | B |
DOB Month | Calculated Text | Calculates and displays the month of a person's birthday in three character format, and prefix with the month number to sort by chronological order of months. | ="("&TEXT(MONTH(DOB),"00")&")"&" "& CHOOSE(MONTH(DOB), "JAN","FEB","MAR","APR","MAY","JUN", "JUL","AUG","SEP","OCT","NOV","DEC") | (06) JUN |
Years | Calculated Number | Calculates and displays the number of full years based on an employee's hire date and the year of the current date. | =DATEDIF([Hire Date],Created,"Y")
Note Because the data is replaced each week, the Created date always contains the current year. The third argument, "Y", ensures a full year is calculated. | 12 |
Seniority | Calculated Text | Calculates and displays an employee's seniority level for awards granted every five full years of service up to 20 years. | =IF(Years<=5,"Level 05",IF(Years<=10,"Level 10",IF(Years<=15,"Level 15","Level 20"))) | Level 15 |
We humbly submit to you that the Group By feature, introduced in Windows SharePoint Services 3.0, is underrated and underused. If your lists are getting bigger all the time and you are noticing a "slowdown", grouping data before it's displayed is a simple but effective way to improve performance and usability.
Comments
Post a Comment