I would like to use a SOQL query to daily assess all accounts based on opportunities The account with the highest opportunity value over the past year is ranked 1 and so on. Any Idea ?
Thanks for the code. but I need a simple query. in that query I need the total amout of an opp related to an account over the past year . The result should be ranked by the hightest value (DESC)
My query should look like this : SELECT Name, AccountId, SUM(Amount) FROM Opportunity WHERE Date=LAST_YEAR GROUP BY "Rank"DESC But I don't know how to do !
Hi WildMan,
please find the solution
If you find this solution is helpful for you please mark the best answer