multiple options in a chart

by KristineHowkinsLange » Fri Feb 19, 2016 8:32 am

Hi
Is it possible to display multiple options as single options in a chart. I have a SharePoint list with six user profiles where more than one user profile can be selected. This means that my chart is impossible to decipher because each of the different combinations shows up as a separate new entry. I'd like to see the number of records that just has each of the user profiles assigned. For example, how many records have the Developer user profile assigned, not listing records that have the Admin and the Developer user profile assigned as a separate entry from the one with just the Developer user profile assigned (there seems to be over 10 combinations of these).

Is there a setting that I'm missing?
Thanks
Kristine
Attachments
plumsail_multiple options.png
screenshot showing chart
plumsail_multiple options.png (24.82 KiB) Viewed 578 times
User avatar
KristineHowkinsLange
 
Posts: 8
Joined: Wed Feb 10, 2016 3:54 pm

by Rostislav » Fri Feb 19, 2016 11:30 am

Your course of action:

1. Go to Data Source -> Advanced, replace existing handlers.requestSuccess function with the following:

Code: Select all
handlers.requestSuccess = function(data, logger) {
  var newDataItems = [];
  for (var i = 0; i< data.items.length; i++) {
    var currentItem = data.items[i];
    //MultiChoice is the internal name of the roles column (developer, etc) - replace as appropriate
    for (var p = 0; p < currentItem.MultiChoice.length; p++) {
      var newItem = $.extend(true, {}, currentItem);
      newItem.SingleRole = currentItem.MultiChoice[p];
      newDataItems.push(newItem);
    }
  }
  data.items = newDataItems;
  return true;
}


2. Click "Process"
3. In Data Source -> Aggregation select "SingleRole" as the Group By column. Click Process.
4. In Dashboard -> Chart select:
Display each group as separate series - yes
Category - SingleRole
Value - whatever you had before
Aggregate over category - yes
Function - sum

That should do it, let us know if you run into problems
User avatar
Rostislav
 
Posts: 61
Joined: Fri Oct 09, 2015 10:51 am

by KristineHowkinsLange » Fri Feb 19, 2016 12:18 pm

]Hi again
I know it's probably because I did this wrong, but I didn't have any luck:
[attachment=0]plumsail_multiple options1.png[/attachment
Attachments
plumsail_multiple options3.png
plumsail_multiple options3.png (22.87 KiB) Viewed 573 times
plumsail_multiple options2.png
code with mutlichoice replaced
plumsail_multiple options2.png (43.46 KiB) Viewed 573 times
plumsail_multiple options1.png
result
plumsail_multiple options1.png (30.63 KiB) Viewed 573 times
User avatar
KristineHowkinsLange
 
Posts: 8
Joined: Wed Feb 10, 2016 3:54 pm

by Rostislav » Fri Feb 19, 2016 1:41 pm

Like you have done in the previous forum thread, you need to use the internal name of the field which you have correctly identified last time in the CamlQuery section. (Where it says <FieldRef Name="InternalName"/>).
Also, I see you're using ID as the value field, so I suppose you'll want the count function, instead of sum.
User avatar
Rostislav
 
Posts: 61
Joined: Fri Oct 09, 2015 10:51 am

by KristineHowkinsLange » Fri Feb 19, 2016 2:24 pm

Hi again
I'm really sorry to be so slow on the uptake, but I'm not getting the right result. I still see a single block of green. The only internal reference that I could see was Word_x0020_document_x003a_User_x, which I tried replacing in the code in the Advanced section. I also changed the Sum to Count in the Function field, none of it works.

Here's the Caml query:
plumsail_multiple options4.png
plumsail_multiple options4.png (29.08 KiB) Viewed 567 times
User avatar
KristineHowkinsLange
 
Posts: 8
Joined: Wed Feb 10, 2016 3:54 pm


Return to Dashboard Designer for SharePoint 2013