The dynamic part of the formula is based on year (see below) - if the close date is less than a certain date parameter, the field on Opportunity should reference the correct Quota value (E.g. if Q1 Quota, this is calculated as Annual Quota * Q1 Quota % - this data is held on the Quota object and referenced in the formula below)
The year needs to be dynamic as I would like this to be future proofed
IF(CloseDate < DATE(YEAR(TODAY()),10,31), Quota__r.Q1_Quota__c,
IF(CloseDate <= DATE(YEAR(TODAY()),11,30), Quota__r.Q1_Quota__c,
IF(CloseDate <= DATE(YEAR(TODAY()),12,31), Quota__r.Q1_Quota__c,
IF(CloseDate <= DATE(YEAR(TODAY()),1,31), Quota__r.Q2_Quota__c,
IF(CloseDate <= DATE(YEAR(TODAY()),2,29), Quota__r.Q2_Quota__c,
IF(CloseDate <= DATE(YEAR(TODAY()),3,31), Quota__r.Q2_Quota__c,
IF(CloseDate <= DATE(YEAR(TODAY()),4,30), Quota__r.Q3_Quota__c,
IF(CloseDate <= DATE(YEAR(TODAY()),5,31), Quota__r.Q3_Quota__c,
IF(CloseDate <= DATE(YEAR(TODAY()),6,30), Quota__r.Q3_Quota__c,
IF(CloseDate <= DATE(YEAR(TODAY()),7,31), Quota__r.Q4_Quota__c,
IF(CloseDate <= DATE(YEAR(TODAY()),8,31), Quota__r.Q4_Quota__c,
IF(CloseDate <= DATE(YEAR(TODAY()),9,30), Quota__r.Q4_Quota__c
,0
))))))))))))
What am I doing wrong?
1 risposta
Just replace the YEAR(TODAY()) with YEAR(CloseDate) in the formula and see if that helps.
also, is your requirement if the closedate falls in a certain quarter use that quarter quota for the calculations?