I have a test content type that has a test name (A or B) and whether the Test is a pre-test or a post-test. Given the following data from that content type:

Test Type
A Pre
A Pre
A Post
B Pre
B Post
B Post

I am able to use Views aggregation to get the total number of each Survey, or total by type across two rows:

Survey Type Total
A Pre 2
A Post 1

But I am trying to use views to aggregate the data so that it shows the total number of pre-tests and post tests for each Survey to look something like:

Survey Pre Post
A 2 1
B 1 2

Any ideas or direction on whether this is possible using Views Aggregate or another Views add-on module?

1 Answer 1


You can try to do this with the Views Aggregator Plus Module (https://www.drupal.org/project/views_aggregator).

Try the following steps to achieve your goal:

  1. Install the views_aggregator module.

  2. Create the basic table and add a second "Type" column. Name the first one "Pre" and the second one "Post". Don't use the default aggregation. The table should than look like this:

Test Pre Post A Pre Pre A Pre Pre A Post Post B Pre Pre B Post Post B Post Post
  1. Select as format the "Table with aggregation options".
  2. Use for the "Test" column the "Apply group function" with "Group and compress". For the "Pre" column the "Apply group function" with "Count (having regexp)" and as Parameter "Pre" and for the "Post" column the same with the parameter "Post".
  3. After saving your table should look like expected.

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.