You need to sign in to do that
Don't have an account?
vishnu nv
How to calculate No. of days in Specific Stage
Hi,
I have used below SOQL query for calculating the No of days in the stage.
SELECT name, StageName from opportunity WHERE isClosed=false AND ((StageName ='Validate' AND Id in (SELECT opportunityId from opportunityHistory WHERE StageName ='Validate' AND CreatedDate=LAST_N_DAYS:20)) OR (StageName ='Connect' AND Id in (SELECT opportunityId from opportunityHistory WHERE StageName ='Connect' AND CreatedDate=LAST_N_DAYS:20)) OR (StageName ='Negotiate' AND Id in (SELECT opportunityId from opportunityHistory WHERE StageName ='Negotiate' AND CreatedDate=LAST_N_DAYS:20)))
But its not working , as it has some limitations.
Can you please help
I have used below SOQL query for calculating the No of days in the stage.
SELECT name, StageName from opportunity WHERE isClosed=false AND ((StageName ='Validate' AND Id in (SELECT opportunityId from opportunityHistory WHERE StageName ='Validate' AND CreatedDate=LAST_N_DAYS:20)) OR (StageName ='Connect' AND Id in (SELECT opportunityId from opportunityHistory WHERE StageName ='Connect' AND CreatedDate=LAST_N_DAYS:20)) OR (StageName ='Negotiate' AND Id in (SELECT opportunityId from opportunityHistory WHERE StageName ='Negotiate' AND CreatedDate=LAST_N_DAYS:20)))
But its not working , as it has some limitations.
Can you please help
Check similar references below.
https://salesforce.stackexchange.com/questions/376866/how-to-calculate-report-on-the-time-between-two-specific-stages
https://developer.salesforce.com/forums/?id=9062I000000IEY1QAO
Thanks,