0

I have a list that contains data I would like to present in a chart. I am able to create a BASIC chart using the Chart Web Part but I need to have it count items automatically.

My list has multiple buildings (11CW, 22CW, NYC) and multiple seats. I need to show the total number of Occupied seats and Vacant seats per building. My problem is I do not have a total column. The list is written like below:

(11CW) Occupied
(11CW) Vacant
(11CW) Occupied
(22CW) Vacant
(22CW) Vacant
(NYC) Occupied
(NYC) Occupied
(NYC) Vacant
(NYC) Vacant

I need the chart to show 2 double columns. One for each building that is split into 2 (occupied and vacant) like in the example below:

Example Chart

3
  • ok, I tried to add a picture and that didn't work. I need the chart to show 1 BLDG heading but 2 columns (for each occupancy option). May 22, 2017 at 13:58
  • What are you using to create the chart? May 22, 2017 at 18:02
  • I am using the SharePoint Chart Web Part May 23, 2017 at 15:56

1 Answer 1

2

What worked for me was to use lookup fields as well as an additional list to act as the counter. You will connect the additional list to the chart web part instead of the main list.

First I created list with just the lookup value that I am after:

enter image description here

For this example I used "booked". Then I went to my input list and created a lookup column that grabbed "booked" from this list.

enter image description here

Referring back to the first image, I created a lookup column here that is "count related", you can name the field whatever you like.

enter image description here

Whenever information is entered into your main list the count column will be updated based off the lookup value being inputted. If you do not want users to have to add information to that field and keep it hidden from view, you will need a create a workflow to update that lookup field. Your workflow should look something like this:

enter image description here

In order to update the lookup field be sure that you are using the ID to update the field.

For my workflow, I had a Home List-Main which I was copying the list item to Home List and updating the lookup field on Home List. You may do it a little differently but the main idea is being able to update the lookup field within the workflow.

enter image description here

1
  • hi there, im sure I understand what you are trying to explain I just cannot see your pictures. If this is what I think it is, then I have tried this already. it would work if I only had 1 building but unfortunately I have about 6. The look ups would be the occupancy and I can get counts of anything occupied or vacant BUT cannot get that broken down by building. I have even tried to use the building as the look up but then at that point I cannot separate Occ from Vac. May 23, 2017 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.