Almost any model builder has had to come up with a solution to get the current date in Anaplan. We used to build integrations and use API for that.@JaredDolichposted a greatarticleabout using python for getting today's date.
But this approach has some cons:
But now this can be done by any model builder, without external systems and coding. It will take only 30-60 minutes of your time and no coding to set it up—with CloudWorks.
The idea is to use CloudWorks to run a process that adds up +1 day to line item with date, but we'll also see how it can be made more reliable. This method will save us from Anaplan maintenance or downtime. If they take place at the scheduled time, we'll be protected.
Create a module with a dummy item (dummy item will help to set up import action). The screenshot below shows a blueprint of the module.
MAIN date- current date, the value is imported fromMAIN date + 1on a scheduled basis via CloudWorks.
MAIN date + 1- formula adds +1 day toMAIN dateline item. It also checks if the last run of MAIN process has failed. If so, it adds up +2 days toMAIN date, so we get back to the correct date.
MAIN last run failed?- checking if the last scheduled run of MAIN process has failed. IfBACKUP dateis greater thanMAIN date, we understand that MAIN run has failed (because we schedule MAIN process to run first, before BACKUP).
BACKUP date- same as main, but works as a backup and is imported from BACKUP date + 1
BACKUP date + 1- formula adds +1 day to BACKUP date line item. It also checks if last run of BACKUP process failed. If so, it adds up +2 days to BACKUP date to correct itself.
BACKUP last run failed?- checking if the last scheduled run of BACKUP process has failed. We do it by comparing the difference between backup and main dates. It shouldn't be more than 1 day. If so, it means the last run of the backup process has failed.
当前日期的最后- takes maximum between MAIN and BACKUP dates, so if one of them has failed, current date final will be correct.
设置两个观点MAIN date + 1andBACKUP date + 1line items are visible. Use these views to set up import of date fromMAIN date + 1intoMAIN dateandBACKUP date + 1intoBACKUP daterespectively. Both imports then should be included in separate processes, so we can schedule them with CloudWorks.
Schedule main and backup CloudWorks processes. I scheduled main for 00:30 AM and backup for 6:00 AM local time (Anaplan maintenance usually takes four hours). You can learn how to set up CloudWorks integrationhere.
You'll need to manually input the correctMAIN dateandBACKUP datefor the first time. Going forwardthe process takes care of it.
That's it! You now have a current date in a model, which is protected from outages and maintenances.
Cleverly! Thanks for the advice, we will use
We will use too!! Thanks for the tip
Awesome article@Hayk- clearly one of the most critical imports needed for a fully automated anaplan data integration initiative. Hopefully we'll get the TODAY() function eventually.
wow!!! Neat and Clever. Awesome@Hayk. And I agree with@JaredDolichto have TODAY() function in Anaplan lists of functions.
BEAUTIFUL!
Clever! especially the backup date part Thanks for sharing
Ingenious!! Thanks for sharing!
@Haykthis is very creative, and great community content! thank you for posting
This was a great solution, thanks for sharing@Hayk.