Today's Date

Hi, How can i refer Today's Date in a formula so as the values would change every day based on that days date. For e.g. if its 09th june then the formula should give result as 09th june . The next day i.e. 10th june the value should get updated to 10th june. Is there any such functionality or formula available inside Anaplan. Please let me know ThankYou

Best Answers

  • Hi Leo, 

    Here's the script that I've used that is setup to run as a .bat file. You'll need to just rename the .txt to .bat to convert it back. 


Answers

  • Emily
    Would be great if you can point to / send this script to me. We are looking to solve a similar issue at one of our customers.

    [quote]Emily DunnPavan,

    There is a script available through Anaplan Connect that will allow the import of today's date into the model. This is the only way that the date can be updated throughout the model. There are no formulas that will enable that function to automatically happen.

    If you are interested in that script, please let me know and I can get that to you.
    Thank you!
    Emily[/quote]
  • Can I have this script as well?
  • Can i have the script?thanks!

  • Could i have a copy of the script please. I have one currently but it is not reliable.

     

    Thank you

     

  • Hi Emily,

     

    Do you have the .bat version instead of .sh?

     

    Thanks.

    Leo

  • @alec_judd or @greg_kajewski - See Leo's question, please. Do you have a .bat available?

  • Thanks Greg!

  • Hi @greg_kajewski!

     

    Thanks for the .bat file.

    I have a question to get it running though:

    It says to customize the following directory:

    This variable AC_exe should be set to the path of the AnaplanClient.bat
    set AC_exe=D:\Anaplan\AnaplanClient.bat

    but since Anaplan models are running completely web-based and there is no local client running I do not see how I can access this path. I have not a lot of technical know-how on how these things work, but if you could clarify a little it would be very helpful.

  • Hi Lukas, 

    When you download Anaplan Connect, it comes with a java based client. Therefore, the path is calling a small application within this download. 

     

    Feel free to use this link to download Anaplan Connect and don't hesitate to reach out if you have any additional questions. 

    Thanks!
    Greg

  • Hi ,

     

    Can you please share the script 

  • schulze
    edited August 2023

    This can be done in CloudWorks, without the need for batch/shell scripts. This particular use of CloudWorks is fairly simple.

  • how would you update the script above to include current date and time?

  • This is pretty technical example and assumes you have a Unix or Windows shell where you are running a script. Also this is just a quick reply because I have not reviewed that script above.

    In Unix shell script syntax, this will capture system date and time into files, so it may help you to get started:

    date "+%Y%m%d" >./date.txt
    cat date.txt

    date "+%H:%M:%S" >./time.txt
    cat time.txt

    This is a similar thing in a batch script:

    :: set date and time variables

    @SET ANAPLAN_YYYY=%DATE:~-4,4%

    @SET ANAPLAN_MM=%DATE:~-10,2%

    @SET ANAPLAN_DD=%DATE:~-7,2%

    @SET ANAPLAN_HOUR=%TIME:~0,2%

    @IF "%ANAPLAN_HOUR:~0,1%" == " " SET ANAPLAN_HOUR=0%ANAPLAN_HOUR:~1,1%

    SET ANAPLAN_TIME=%ANAPLAN_HOUR:~0,2%%TIME:~3,2%%TIME:~6,2%

    :: YYYYMMDD
    SET ANAPLAN_DATE=%ANAPLAN_YYYY%%ANAPLAN_DD%%ANAPLAN_DD%
    echo %ANAPLAN_DATE%

    echo %ANAPLAN_DATE% > date.txt
    echo %ANAPLAN_TIME% > time.txt

    type date.txt
    type time.txt

    :: sample
    :: from set|more
    :: ANAPLAN_DD=04
    :: ANAPLAN_MM=06
    :: ANAPLAN_YYYY=2019
    :: ANAPLAN_TIME=161538