I have to count nodes grouping them by two different entity reference fields and get the row and column count for each.
When I set one entity reference field as Crosstab column, in the table header it's rendered the target_id instead of the title of the referenced entity. It still happens if I invert the fields from Crosstab column to Crosstab row: the row header is rendered correctly, but not the column header.
If I try to add a title filed with a relationship to the referenced entity with no title in column header I get the error "the Crosstab does not appear to be configured".
Any workaround?
Thanks

Comments

danchadwick’s picture

Status: Active » Fixed

You've probably exceeded the modules very limited abilities. It is really intended to work with a very simple single table as it modifies the query to generate fields for the columns. I would try Views Pivot, which works by retrieving all the data and then processing in the render stage. It might work for your use case.

cheope’s picture

Thank you very much. I've already tryed Views Pivot and Views Matrix but I discarded both as I couldn't find a way to add an extra total row and column like Crosstab does out of the box. Following your suggestion, I've just found this patch and I'll give it a try. Thanks again for the help and for your great module.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

nithinkolekar’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
StatusFileSize
new217.28 KB

wow "Only maintainers can reopen." , D.O following S.O.

I think op is not having any problem with functionality of the module which is to show data in crosstab manner.

While testing I also got the same behavior of target_id getting rendered instead of Entity reference title. But with the rows entity reference is working fine.
as for the Views Pivot , if data results are huge it will lead to memory exhaust error but with crosstab no problem at all.
with a result set of ~6500 rows
views crosstab
Query build time 59.47 ms
Query execute time 66.15 ms
View render time 27.1 ms

with views pivot
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted

avpaderno’s picture

Issue tags: -#entity +#entity