I came here because I have a problem with view calc module and several lines in my field collection. So first the result of my view look like this :

My view

All this fields are in the same content type, and I put sum calculation on each fields. But it's seems the value of the field is multiplied by the count of lines in my field collections. So for the first sum(Montant HT) the calcul done is :

8600 + 51600 + (3101.26 * 5) + 2962.99 + (42000 * 3)

For the column paid sum I don't know how the sum is calculated I doesn't understand.

I tried to use distinct but it didn't work, so how can I found the right sum for all my column ??


  • Can I UP this post ?
    – Cracs
    Nov 16, 2015 at 16:55

1 Answer 1


Finally, I found a way to make it work. Although, maybe it's not a good solution but it worked. Here is steps:

  1. Find file views_calc_table.inc in views_calc module directory.
  2. Change if ($query_alias == 'unknown') { to if ($query_alias == 'unknown' || $field->field_info['type'] == 'field_collection') { in line 238 under function add_aggregation_fields(&$view)

Remind,never hack core!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.