I'm new here and trying to build a site while learning the development side of drupal so please bear with me and excuse any ignorance. Any help is appreciated in advance.

I'm trying to figure out how to build a views table which will show columnar data from my results. I'm using non-"summable" voting options which is why getting the result is tricky. Ideally I'd like the resulting view table to look like

Node Title -----------  Vote Option 1 (e.g. "Happy")  ------ Vote Option 2 ("Sad")  --- Vote Option 3 ("Mad")
=======================================================
some node title --------------- 4 ------------------------------------------  3  ----------------------------- 1
another node title ------------ 1 ------------------------------------------  2  ----------------------------- 0
....

I'm using the Rate module for my voting api integration. My database tables look correct (votingapi_vote and votingapi_cache) and I'm able to correctly view the results of individual votes on the Rate module %node/results page.

I've read through some of the documentation and had the following results:

  • Built the relationship from the node to the voting results through the Views->Relationship->Node: Vote results
  • Filtered the results to show only the votes (nodes) I want. I can verify through the field Node: Title output.
  • Only the "unfiltered" option works for the relationship: "Value type" which I understand to be correct
  • Only the "unfiltered" option work for the relationship: "Aggregation" option. I was kinda hoping the "number of votes" option would work since it seems to be what I want.
  • With the "unfiltered" option I get a flat list of the vote count for each option as a separate record. E.g.:
    • node title 1 --- [count] 4 ---- option1
    • node title 1 --- [count] 3 --- option 2
    • nde title 1 --- [count] 1 --- option 3".
  • I've tried all sorts of Grouping in views but haven't had success turning this into a single record with the total count for each option
  • I've also tried playing around with the options in Views: Style Settings -> Style = Table but haven't any success

Any tips or advice is appreciated. Thanks in advance.

Comments

MGParisi’s picture

subscribe

greggles’s picture

Version: 7.x-2.4 » 7.x-2.x-dev

tweaking metadata.

I wonder if this feature existed in old versions of VAPI and was removed in the upgrade or if it's just never existed. I think you can view data from votingapi_cache table which I just confirmed has these counts in it.

I think the answer to doing this depends on which Voting module you are using and whether or not you have any custom code to create additional values in the votingapi_cache table.

@mgparisi @jonlhouse - which module are you using that you want to display?

I'm currently working on the Rate module and think the problem may be in how Rate calculates the cache values for "emotion" votes.

greggles’s picture

I should say, for Rate module the issue with the most detail that I could find is #1332574: Create views relationship to just one option in a multi-option vote.

greggles’s picture

Issue summary: View changes

Updated issue summary.

rjacobs’s picture

Set related issue which this might be a dup of (need to see how that related issue plays out to know for sure).