The Data
Name Date Span
Bob 12/11 0700-1530
Sue 12/11 0700-1530
Bob 12/12 0700-1530
Sue 12/12 0700-1530
Bob 12/13 0700-1530
Sue 12/13 0700-1530
Bob 12/14 0700-1530
Sue 12/14 0700-1530
Bob 12/15 0700-1530
Sue 12/15 0700-1530
Sue 12/16 1200-1830
How can I present the data as follows, with one row per person?
Sun Mon Tue Wed Thu Fri Sat
10DEC 11DEC 12DEC 13DEC 14DEC 15DEC 16DEC
Bob 0700-1530 0700-1530 0700-1530 0700-1530 0700-1530
Sue 0700-1530 0700-1530 0700-1530 0700-1530 0700-1530 1200-1830
The span might be different on different days for the same person, and there might more or fewer names for any given week. If I remember right, this is the purpose of 'cross-tab queries,' which Access can do, but I am not to sure in SharePoint.
There isn't a way to achieve that out of the box. What you'd likely need to do is use client side rendering to change the way the view is displayed. Here is a sample of a js file that changes a view's rendering (doesn't achieve what you're looking for but it's a start). The customItem function is where you'll define what each cell looks like. Then you can manipulate the results in the post render. Hopefully this can get you going down the right path. This is a good guide for getting started with CSR: https://www.codeproject.com/Articles/620110/SharePoint-Client-Side-Rendering-List-Views
(function () {
// Initialize the variable that stores the objects.
var overrideCtx = {};
overrideCtx.Templates = {};
// Assign functions or plain html strings to the templateset objects:
// header, footer and item.
overrideCtx.Templates.Header = "<B><#=ctx.ListTitle#></B>" +
"<hr><ul id='unorderedlist'>";
// This template is assigned to the CustomItem function.
overrideCtx.Templates.Item = customItem;
overrideCtx.Templates.Footer = "</ul>";
// Set the template to the:
// Custom list definition ID
// Base view ID
overrideCtx.BaseViewID = 2;
overrideCtx.ListTemplateType = 10057;
// Assign a function to handle the
// PreRender and PostRender events
overrideCtx.OnPreRender = preRenderHandler;
overrideCtx.OnPostRender = postRenderHandler;
// Register the template overrides.
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
})();
// This function builds the output for the item template.
// It uses the context object to access announcement data.
function customItem(ctx) {
// Build a listitem entry for every announcement in the list.
var ret = "<li>" + ctx.CurrentItem.Title + "</li>";
return ret;
}
// The preRenderHandler attends the OnPreRender event
function preRenderHandler(ctx) {
// Override the default title with user input.
ctx.ListTitle = prompt("Type a title", ctx.ListTitle);
}
// The postRenderHandler attends the OnPostRender event
function postRenderHandler(ctx) {
// You can manipulate the DOM in the postRender event
var ulObj;
var i, j;
ulObj = document.getElementById("unorderedlist");
// Reverse order the list.
for (i = 1; i < ulObj.children.length; i++) {
var x = ulObj.children[i];
for (j = 1; j < ulObj.children.length; j++) {
var y = ulObj.children[j];
if(x.innerText<y.innerText){
ulObj.insertBefore(y, x);
}
}
}
}