You need to sign in to do that
Don't have an account?
Phani Pydimarry 4
Compare two dates in two different months with a time frame on Salesforce
I have a scenario where I have two Dates on Account.
Our partners move up to a level above if they buy a product in this month. But the data coming to us shows they moved up in the next month (1st to 10th) as they are processed in this time frame.
For Example
Date1: Joining Date Say 5/12/2017 MovedupDate: Moved up date Say 4/1/2018
I would like to create a flag on Account which say if the Partner moved up to a level within the same Month or the next month 1st to 10th it would come up as 'YES' or '1'. Please help me with a solution to accomplish this. My first thoughts are Process builder.
Our partners move up to a level above if they buy a product in this month. But the data coming to us shows they moved up in the next month (1st to 10th) as they are processed in this time frame.
For Example
Date1: Joining Date Say 5/12/2017 MovedupDate: Moved up date Say 4/1/2018
I would like to create a flag on Account which say if the Partner moved up to a level within the same Month or the next month 1st to 10th it would come up as 'YES' or '1'. Please help me with a solution to accomplish this. My first thoughts are Process builder.
Data TypeFormula
AND(YEAR( Movedup_date__c ) = YEAR( Joining_date__c),MONTH(Movedup_date__c ) = MONTH( Joining_date__c))
||
AND(YEAR( Movedup_date__c) = YEAR( Joining_date__c ),MONTH(Movedup_date__c ) = (MONTH( Joining_date__c)+1),DAY(Movedup_date__c) <= 10)
||
AND(YEAR( Movedup_date__c) = (YEAR( Joining_date__c)+1),MONTH(Movedup_date__c ) = (MONTH( Joining_date__c)-11),DAY(Movedup_date__c) <= 10)
Please let me know if it works.
Thanks,
Saravana
All Answers
You can create a formula checkbox if the moved up date is within the same month.
AND(YEAR( Moved up date) = YEAR( Joining Date),MONTH( Moved up date ) = MONTH( Joining Date ))
Please let me know if it helps.
Please don't forget to mark this as solved if it's resolved.
Thanks,
Saravana
Thanks
AND(YEAR( Moved up date) = YEAR( Joining Date),MONTH( Moved up date ) = MONTH( Joining Date ))
||
AND(YEAR( Moved up date ) = YEAR( Joining Date ),MONTH( Moved up date ) <> MONTH( Joining Date ),DAY(Moved up date) <= 10)
Thanks,
Saravana
Thanks,
Saravana
AND(YEAR( Moved up date) = YEAR( Joining Date),MONTH( Moved up date ) = MONTH( Joining Date ))
||
AND(YEAR( Moved up date ) = YEAR( Joining Date ),MONTH( Moved up date ) = MONTH( Joining Date )+1,DAY(Moved up date) <= 10)
Thanks,
Saravana
If the Partner enrolled in 10/10/2017 and Moved up in 10/11/2017 (or from 1 to 10 of November) then the flag should be Yes
Preseant Result
If the Partner enrolled in 10/10/2017 and Moved up in 10/12/2017 the result is showing up as True but this should not be the case
Thanks for coming back
Sorry slight changes in the formula use this one.
Data TypeFormula
AND(YEAR( Movedup_date__c ) = YEAR( Joining_date__c),MONTH(Movedup_date__c ) = MONTH( Joining_date__c))
||
AND(YEAR( Movedup_date__c) = YEAR( Joining_date__c ),MONTH(Movedup_date__c ) = (MONTH( Joining_date__c)+1),DAY(Movedup_date__c) <= 10)
Thanks,
Saravana
Thanks,
Saravana
Thanks,
Saravana
|| AND(YEAR( Assistant_Supervisor_Date__c ) = YEAR( Enrollment_Date_Formula__c ),MONTH( Assistant_Supervisor_Date__c ) <> (MONTH(Enrollment_Date_Formula__c)+1),DAY(Assistant_Supervisor_Date__c) <= 10)
You have used <> which is not equals to but I have checkrd if both month are equals.
Changed formula.
AND(YEAR( Assistant_Supervisor_Date__c) = YEAR( Enrollment_Date_Formula__c),MONTH( Assistant_Supervisor_Date__c ) = MONTH( Enrollment_Date_Formula__c ))
|| AND(YEAR( Assistant_Supervisor_Date__c ) = YEAR( Enrollment_Date_Formula__c ),MONTH(Assistant_Supervisor_Date__c ) = (MONTH(Enrollment_Date_Formula__c)+1),DAY(Assistant_Supervisor_Date__c) <= 10)
Let me know if it works as you expected.
Thanks,
Saravana
You have used <> which is not equals to but I have checked if both month are equals.
Changed formula.
AND(YEAR( Assistant_Supervisor_Date__c) = YEAR( Enrollment_Date_Formula__c),MONTH( Assistant_Supervisor_Date__c ) = MONTH( Enrollment_Date_Formula__c ))
|| AND(YEAR( Assistant_Supervisor_Date__c ) = YEAR( Enrollment_Date_Formula__c ),MONTH(Assistant_Supervisor_Date__c ) = (MONTH(Enrollment_Date_Formula__c)+1),DAY(Assistant_Supervisor_Date__c) <= 10)
Let me know if it works as you expected.
Thanks,
Saravana
Please see below.
Assistant supervisor date - 10-10-2017 (10-Oct-2017)
Enrolment Date - 10-11-2017 (10-Nov-2017)
Formula
AND(YEAR( Assistant_Supervisor_Date__c) = YEAR( Enrollment_Date_Formula__c),MONTH( Assistant_Supervisor_Date__c ) = MONTH( Enrollment_Date_Formula__c ))
|| AND(YEAR( Assistant_Supervisor_Date__c ) = YEAR( Enrollment_Date_Formula__c ),MONTH(Assistant_Supervisor_Date__c ) = (MONTH(Enrollment_Date_Formula__c)+1),DAY(Assistant_Supervisor_Date__c) <= 10)
Explanation:
AND(Year(2017=2017),Month(10=10))
||
AND(Year(2017=2017),Month(11=(10+1),10<=10)
Thanks,
Saravana
Assistant supervisor date - 10-12-2017 (10-Oct-2017)
Enrolment Date - 10-01-2018 (10-Nov-2017)
AND(Year(2017=2017),Month(12=12))
||
AND(Year(2017=2017),Month(11=(10+1),10<=10) ----- How would this work?
How can I add a Year to this data?
Data TypeFormula
AND(YEAR( Movedup_date__c ) = YEAR( Joining_date__c),MONTH(Movedup_date__c ) = MONTH( Joining_date__c))
||
AND(YEAR( Movedup_date__c) = YEAR( Joining_date__c ),MONTH(Movedup_date__c ) = (MONTH( Joining_date__c)+1),DAY(Movedup_date__c) <= 10)
||
AND(YEAR( Movedup_date__c) = (YEAR( Joining_date__c)+1),MONTH(Movedup_date__c ) = (MONTH( Joining_date__c)-11),DAY(Movedup_date__c) <= 10)
Please let me know if it works.
Thanks,
Saravana
Thanks,
Saravana