I am trying to come with some logic to figure out what Opportunities have progressed in a week. One thing I was thinking of doing was getting the latest and earliest stages for the Opportunities from the Opportunity History table.
Then comparing the stages and this will indicate if an Opportunity has progressed or not.
So, do get the latest. I could do something like:
SELECT Amount, CloseDate, CreatedById, CreatedDate, IsDeleted, ExpectedRevenue,
Id, OpportunityId, Probability, StageName, SystemModstamp, ForecastCategory
FROM OpportunityHistory
WHERE OpportunityId = 'blah'
order by createdDate desc limit 1
However, I need to do this for all Opportunities that belong to a certain bunch of Users. I am not sure how to do this. Any tips?
Thanks.