I want to create a table displaying counts of users' authored nodes and revisions (we're doing some "wiki" type stuff). This is for a "top contributors" type display.
The table should be structured with three columns: Name, Posts, Revisions. The table should list users under "Name" and numbers under "Posts" and "Revisions".
I feel like I got halfway there and got stumped. Here's what I set up in a view:
(NOTE: Users are affiliated with organizations via References module and "Organization" content type, I'm trying to display users affiliated with the org on the org page.)
Fields:
(author) User: Name (Staff)
COUNT(Content: Title) (Title)
(revision user) User: Name (Name)
COUNT(Content revision: Vid) (Vid)
Filter Criteria:
Content: Type (= Resource)
Sort Criteria: NONE
Contextual Filters:
(author) User: Organization - Provide default value: Content ID from URL
Relationships:
Content: Author
(author) User: Organization
Content revision: User
(revision user) User: Organization
Other:
Use Aggregation: Yes
The result I get shows the same number of posts as revisions - even when I go throw in a few additional revisions to test.
Where am I going wrong? How do I do this properly?
ADDED TO QUESTION
Here's the full view export:
$view = new view();
$view->name = 'staff_contributions';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Staff Contributions';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Staff Contributions';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['group_by'] = TRUE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['pager']['options']['items_per_page'] = '5';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Relationship: Content: Author */
$handler->display->display_options['relationships']['uid']['id'] = 'uid';
$handler->display->display_options['relationships']['uid']['table'] = 'node';
$handler->display->display_options['relationships']['uid']['field'] = 'uid';
/* Relationship: User: Organization (field_organization) */
$handler->display->display_options['relationships']['field_organization_nid']['id'] = 'field_organization_nid';
$handler->display->display_options['relationships']['field_organization_nid']['table'] = 'field_data_field_organization';
$handler->display->display_options['relationships']['field_organization_nid']['field'] = 'field_organization_nid';
$handler->display->display_options['relationships']['field_organization_nid']['relationship'] = 'uid';
$handler->display->display_options['relationships']['field_organization_nid']['delta'] = '-1';
/* Relationship: Content revision: User */
$handler->display->display_options['relationships']['uid_1']['id'] = 'uid_1';
$handler->display->display_options['relationships']['uid_1']['table'] = 'node_revision';
$handler->display->display_options['relationships']['uid_1']['field'] = 'uid';
/* Relationship: User: Organization (field_organization) */
$handler->display->display_options['relationships']['field_organization_nid_1']['id'] = 'field_organization_nid_1';
$handler->display->display_options['relationships']['field_organization_nid_1']['table'] = 'field_data_field_organization';
$handler->display->display_options['relationships']['field_organization_nid_1']['field'] = 'field_organization_nid';
$handler->display->display_options['relationships']['field_organization_nid_1']['relationship'] = 'uid_1';
$handler->display->display_options['relationships']['field_organization_nid_1']['delta'] = '-1';
/* Field: User: Name */
$handler->display->display_options['fields']['name']['id'] = 'name';
$handler->display->display_options['fields']['name']['table'] = 'users';
$handler->display->display_options['fields']['name']['field'] = 'name';
$handler->display->display_options['fields']['name']['relationship'] = 'uid';
$handler->display->display_options['fields']['name']['label'] = 'Staff';
/* Field: COUNT(DISTINCT Content: Title) */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['group_type'] = 'count_distinct';
/* Field: User: Name */
$handler->display->display_options['fields']['name_1']['id'] = 'name_1';
$handler->display->display_options['fields']['name_1']['table'] = 'users';
$handler->display->display_options['fields']['name_1']['field'] = 'name';
$handler->display->display_options['fields']['name_1']['relationship'] = 'uid_1';
/* Field: COUNT(DISTINCT Content revision: Vid) */
$handler->display->display_options['fields']['vid']['id'] = 'vid';
$handler->display->display_options['fields']['vid']['table'] = 'node_revision';
$handler->display->display_options['fields']['vid']['field'] = 'vid';
$handler->display->display_options['fields']['vid']['group_type'] = 'count_distinct';
/* Contextual filter: User: Organization (field_organization) */
$handler->display->display_options['arguments']['field_organization_nid']['id'] = 'field_organization_nid';
$handler->display->display_options['arguments']['field_organization_nid']['table'] = 'field_data_field_organization';
$handler->display->display_options['arguments']['field_organization_nid']['field'] = 'field_organization_nid';
$handler->display->display_options['arguments']['field_organization_nid']['relationship'] = 'uid';
$handler->display->display_options['arguments']['field_organization_nid']['default_action'] = 'default';
$handler->display->display_options['arguments']['field_organization_nid']['default_argument_type'] = 'node';
$handler->display->display_options['arguments']['field_organization_nid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['field_organization_nid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['field_organization_nid']['summary_options']['items_per_page'] = '25';
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
'resource' => 'resource',
);
/* Display: Block */
$handler = $view->new_display('block', 'Block', 'block');
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;