Why do I get this ERROR as :MALFORMED Query in Developer console?
I'm trying to use :Group By Roll or Group By CUbe to get the subtotals and grand totals.
When I tried this Query:
SELECT id,gmod__Quantity__c, gmod__Amount__c,GROUPING(gmod__Quantity__c) grpQty, GROUPING(gmod__Amount__c) grpAmt ,COUNT(id) oppfc from gmod__Opportunity_Forecast__c GROUP BY CUBE(gmod__Quantity__c, gmod__Amount__c) ORDER BY GROUPING(gmod__Quantity__c), GROUPING(gmod__Amount__c)
Error as :
MALFORMED QUERY [object Object]: gmod__Opportunity_Forecast__c GROUP BY CUBE(gmod__Quantity__c, gmod__Amount__c) ^ ERROR at Row:1:Column:183 field 'gmod__Quantity__c' can not be grouped in a query call
Similarly I just tried using Grouping By One Rollup Field
SELECT gmod__price__c,COUNT(Name) cnt
FROM gmod__Opportunity_Forecast__c
GROUP BY ROLLUP( gmod__price__c)
Grouping By Two Rollup Field
SELECT gmod__price__c,gmod__Amount__c ,COUNT(Name) cnt
FROM gmod__Opportunity_Forecast__c
GROUP BY ROLLUP( gmod__price__c,gmod__Amount__c)
It does not give any o/p result.