This topic contains 1 reply, has 1 voice, and was last updated by czaros45 6 years, 7 months ago.
- Topic
Hello,
for some reason groupBy isn’t included in datagrid report query.My datagrid report:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263oro_reportcrm-customers-by_cities:pageTitle: vendor.sales.report.customers.by_citiessource:type: ormacl_resource: oro_report_viewquery:select:- s.label as Status- sh.city as City- b.label as Brand- COUNT(ch.id) as Qtyfrom:- { table: vendorSalesBundle:Channel, alias: ch }join:inner:- { join: ch.status, alias: s }- { join: ch.customer, alias: c }- { join: ch.brand, alias: b }- { join: c.shippingAddress, alias: sh }groupBy: Status, City, Brandcolumns:City: { label: vendor.sales.customeraddress.city.label }Status: { label: vendor.sales.channel.status.label }Brand: { label: vendor.sales.brand.entity_label }Qty: { label: vendor.sales.customer.number_of_clients_label }totals:total:extends: grand_totalper_page: truehide_if_one_page: truecolumns:Qty:label: oro.magento.datagrid.columns.page_totalgrand_total:columns:Qty:label: oro.magento.datagrid.columns.grand_totalsorters:columns:City: { data_name: City }Status: { data_name: Status }Brand: { data_name: Brand }Qty: { data_name: Qty }filters:columns:City:type: stringdata_name: CityStatus:type: stringdata_name: StatusBrand:type: stringdata_name: BrandQty:type: numberdata_name: Qtyfilter_by_having: trueoptions:entityHint: report dataexport: trueAnd this results in following report:
Getting grid data failed.
Context: { “exception”: “Exception(Doctrine\\DBAL\\Exception\\DriverException): An exception occurred while executing ‘SELECT e0_.label AS label_0, e1_.city AS city_1, e2_.label AS label_2, COUNT(e3_.id) AS sclr_3 FROM vendor_sales_channel e3_ INNER JOIN vendor_sales_status e0_ ON e3_.status_name = e0_.name INNER JOIN vendor_sales_customer e4_ ON e3_.customer_id = e4_.id INNER JOIN vendor_sales_brand e2_ ON e3_.brand_name = e2_.name INNER JOIN vendor_sales_customer_address e1_ ON e4_.shipping_address_id = e1_.id WHERE e0_.label IN (‘aaaa’) AND e1_.city IN (‘Końskie’) AND e2_.label IN (‘test’) LIMIT 1′:\n\nSQLSTATE[42000]: Syntax error or access violation: 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),…) with no GROUP columns is illegal if there is no GROUP BY clause” }Do you have any idea what may be wrong?
Thank you in advance.
The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.