• Arnie Ug 18
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hi, 

In the controller class of a lightning component, I have this following group by query :
 
SELECT CALENDAR_YEAR(Transaction_Date__c) year,CALENDAR_MONTH(Transaction_Date__c) gbfield, SUM(Net_Net_Sales_EUR__c) amount FROM Sales_Reporting__c
WHERE Transaction_Date__c IN (LAST_N_FISCAL_YEARS:1,THIS_FISCAL_YEAR)
AND Sold_To__r.Country__r.Id ='a4O0L000000QJsKUAW' group by CALENDAR_YEAR(Transaction_Date__c),CALENDAR_MONTH(Transaction_Date__c)
ORDER BY CALENDAR_MONTH(Transaction_Date__c)

In developer console it returns 33 rows.
When i try to run my component i have this error message : 

FATAL_ERROR System.LimitException: Too many query rows: 50001
Number of SOQL queries: 1 out of 100
number of query rows: 139180 out of 50000 *******

My query cannot be more filtered, my component use Chart.js to display Chart, so all the 139180 rows are needed.

Any suggestion ?