Drupal 7.34, latest version of Views. Create a content type A, add an entityreference field on it to another content type B that contains a field with a decimal value, add a term reference field.

Create a view to add up all the values on the entityreferenced content type's decimal field.

If the content type A items don't have values in the term reference field, Views Calc sums the entityreferenced content type B decimal fields properly.

If the content type A items DO have values in the term reference field, Views Calc adds the decimal field again for every value in the term reference field, giving a wrong total.

So if you have, say, 3 content items with values of 1, 2, and 3, respectively, in their entityreferenced decimal fields, and no term reference field values, Views Calc will add that up to a total of 6.

If you add a term reference value - a tag, for example - to the content item with decimal field value "3", though, Views Calc will now count that twice. Bringing the total to 9, when it should be 6. If you add another tag to that same field, it'll add the value again, making it 12 when it should be 6.

So basically Views Calc doesn't work when you're trying to add field values from entityreference fields for content types that also have term reference fields.

I have no idea why it's doing this and have no proposed solutions.

Should also mention the View is using two relationships. Content: Taxonomy terms on node and Entity Reference. Looking around the issue queue I gather there are some problems with this module and relationships.

Comments

reallyordinary’s picture

Issue summary: View changes
delacosta456’s picture

hi
This is an old issue but by installing the below module it may correct that bug
https://www.drupal.org/project/views_calc_distinct