Answers.Body: <p>Check out Charts, Google Charts module - if not for this purpose you'll be using it for some other data displays soon!</p>
  
  <p>Below is a screenshot of a View - Page of Format: Chart -> aggregating by Grant Type over a certain time period [PS - the Table is an attachment -> Format: table]. For your use case try Aggregate by your custom field containing the Colors.</p>
  
  <p><a href="https://i.sstatic.net/2hy8r.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/2hy8r.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-12T22:22:32.273Z
Answers.Text: This would have been really awesome, but Views is treating Civicrm multi-fields as one field. Therefore, "Red, Green" can't be split up.
Answers.UserDisplayName: Kristine
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-12T01:04:42.780Z
Answers.LastActivityDate: 2018-08-12T01:04:42.780Z
Answers.UserDisplayName: KarinG - Semper IT
Answers.Body: <p>I would suggest indeed that you use a php field in your views and a field per option and filter the options out. </p>
  
  <p>The multi value custom fields store their value with a special character as a separator. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-13T09:22:20.843Z
Answers.LastActivityDate: 2018-08-13T09:22:20.843Z
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Body: <p>I collect data in case activities, and I'm currently trying to build a Drupal Views of this data. I'm running into a problem with multiple fields. For example: "What colors do you prefer?" The results are showing up like:</p>
  
  <p>Red, Blue, Green
  Green, Blue</p>
  
  <p>Is there a way to present each line as a color? My end goal is to create a pivot table to show a count of each color. I have a lot of multiple field questions that have this problem right now. The only solution I can think of is to create a PHP code to output a if statement == "RED" line by line.</p>
  
Tags: <civicase><drupal-views>
Title: Drupal Views Multiple Field CiviCRM
ThreadText: # Drupal Views Multiple Field CiviCRM
  
  (Asked by: username_0 on 2018-08-12)
  
  I collect data in case activities, and I'm currently trying to build a Drupal Views of this data. I'm running into a problem with multiple fields. For example: "What colors do you prefer?" The results are showing up like:
  
  Red, Blue, Green
  Green, Blue
  
  Is there a way to present each line as a color? My end goal is to create a pivot table to show a count of each color. I have a lot of multiple field questions that have this problem right now. The only solution I can think of is to create a PHP code to output a if statement == "RED" line by line.
  
  **Tags:** civicase, drupal-views
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-08-12. Score: 2 | Accepted answer
  
  Check out Charts, Google Charts module - if not for this purpose you'll be using it for some other data displays soon!
  
  Below is a screenshot of a View - Page of Format: Chart -> aggregating by Grant Type over a certain time period [PS - the Table is an attachment -> Format: table]. For your use case try Aggregate by your custom field containing the Colors.
  
  [![enter image description here](https://i.sstatic.net/2hy8r.png)](https://i.sstatic.net/2hy8r.png)
  
  > **Comments:**
  > **username_0**: This would have been really awesome, but Views is treating Civicrm multi-fields as one field. Therefore, "Red, Green" can't be split up.  
  
  ---
  
  ### Answer by username_2 on 2018-08-13. Score: 1
  
  I would suggest indeed that you use a php field in your views and a field per option and filter the options out.
  
  The multi value custom fields store their value with a special character as a separator.
  
  
  ---
  
  