write the following code in Anaplan.

edited June 21 in Modeling

Hello everyone, I have two questions. Firstly, I am attempting to write the following code in Anaplan, I am using a calendar time setting (time scle :week) picture attached.

IF Week = 'Week N' (where in my model N=25, representing the 25th week of the year) THEN

Flux_Disp = Starting_Stock - Security_Stock - Demand_Global;

ELSE IF Week = 'Week N+1 ' THEN

Flux_Disp = Final_Stock_of_Week N- Security_Stock - Demand_Global;


Flux_Disp = 0;


Could you please confirm if this code can be written in Anaplan? and how ?

Secondly, I would like to know if there is an equivalent formula in Anaplan for the Excel function AROUND.MULTIPLE.

thanks in advance.


  • @SAtrane

    DISCO will be your new friend here, especially the "S" for system modules. Create, if you haven't already, a system module that is only dimensioned using the weekly calendar. You will, of course, need another driver module that contains the current week. From there it's as simple as identifying the current week in your system module as a BOOLEAN. Refer to that Boolean in your calculations above. You don't want to hard code anything and you don't want to calculate things twice. "Calculate once. Refer often".

    Another nice feature of Anaplan is that you can take a PERIOD formatted line item and just add or subtract from it. So if you want the current week + 1, then just take the weekly period and add one to it.

    You got this!

  • hi @JaredDolich

    Thank you for your response. but Is there a possible way to define the current week in anaplan ?

  • @SAtrane

    Only through an import. There isn't a NOW() or TODAY() function in Anaplan. There was a time however that Anaplan was intending to give us this functionality. The challenge with a function like this is that Anaplan's calculation engine is always on. So there has to be a way to update the current date intermittently without having to burden the calculation engine with having to recalculate the entire model.

    Most implementations will import the current date, week, and/or time (for time stamping purposes) using an import action. The most common way is to use Anaplan Connect and put it on a scheduler. If you have Cloudworks and an AWS repository you can use that without the need of a scheduler since Cloudworks comes with one. Frankly, I just use Python and Windows scheduler. Just make sure your diligent about handling the security - I would not recommend using basic authentication but rather a CA certificate.