Forum Discussion
ChayceDuncan2
7 years agoQrew Cadet
Most of the formula still holds true. I added a bit to it and made it a little cleaner.
//START//
var date initialExpiration = AdjustMonth([Effective],[Term]);
var number numberOfRenewals = ToDays(Today()-$initialExpiration endInitial) / [Renewal (Days)];
if(
[Renewal Exposure]="Auto-Renewal" and
Today() > $initialExpiration,
$initialExpiration + Days(Ceil($numberOfRenewals)*[Renewal (Days)]),
$initialExpiration)
//END//
To explain it in a little more detail:
First - set up what the 'original' expiration date was - AdjustMonth([Effective],[Term]);
Next - in the event that you keep 'auto renewing', figure out how many renewals that actually was. How many times did you cross over into a new renewal period by taking how many days its been since your original expiry date and now --
ToDays(Today()-$initialExpiration endInitial) / [Renewal (Days)];
Then - pull it all back together at the end - if you have an auto-renewal, and I've already passed the original expiry date, then tack on the # of renewals (from above) you've hit, and add the number of days to it
Otherwise, just leave it as the original expiry date.
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base
//START//
var date initialExpiration = AdjustMonth([Effective],[Term]);
var number numberOfRenewals = ToDays(Today()-$initialExpiration endInitial) / [Renewal (Days)];
if(
[Renewal Exposure]="Auto-Renewal" and
Today() > $initialExpiration,
$initialExpiration + Days(Ceil($numberOfRenewals)*[Renewal (Days)]),
$initialExpiration)
//END//
To explain it in a little more detail:
First - set up what the 'original' expiration date was - AdjustMonth([Effective],[Term]);
Next - in the event that you keep 'auto renewing', figure out how many renewals that actually was. How many times did you cross over into a new renewal period by taking how many days its been since your original expiry date and now --
ToDays(Today()-$initialExpiration endInitial) / [Renewal (Days)];
Then - pull it all back together at the end - if you have an auto-renewal, and I've already passed the original expiry date, then tack on the # of renewals (from above) you've hit, and add the number of days to it
Otherwise, just leave it as the original expiry date.
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base