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:

  • You must learn to code or involve someone who can do it. Both options are time-consuming and sometimes require an extra budget.
  • Because we rely on an external system, it brings extra chances of failure (both Anaplan outages and server outages will cause a failure).
  • You'll likely require someone to support it once it's running.

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.

How To Do It

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.

STEP 1:

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.

hayk_0 - 1629440853340.png

Hayk_1-1629442437744.png

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.

STEP 2:

设置两个观点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.

hayk_0 - 1629443522848.png

hayk_0 - 1629443918158.png

STEP 3:

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.

hayk_0 - 1629445721077.png

STEP 4:

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.

The content in this article has not been evaluated for all Anaplan implementations and may not be recommended for your specific situation.
Please consult your internal administrators prior to applying any of the ideas or steps in this article.
评论

Cleverly! Thanks for the advice, we will use:slightly_smiling_face:

We will use too:smiling_face_with_sunglasses:!! 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!:rocket:

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.

Version history
Last update:
‎09-29-202103:56 PM
更新:
About the Author
  • Hayk avatar
    Frequent Contributor
Contributors
Labels(2)