Current system day or To Date
Options
Madhabika
Member, ALL USERS, Partner Posts: 5 Occasional Contributor
Hi Guys,
Can anyone please guide, if we have any syntax for retriving todays date i,e sysdate in Anaplan.
I have created a property with Date formatted,I want to view todays date in this line item.
Thanks
Madhabika
Tagged:
0
Comments
-
Hello Madhabika,
@echo on
:: This script looks up the current date, writes it to a csv file, and sends it to Anaplan
:: Here we set the file path of the csv file we will be writing the current date too
set FileName="\\d-sapfiles\Interfaces\D_ANAPLAN\VOLFCST\OUT\CurrentDate.csv"
:: rem This is a simple for loop that parses the date /t function
FOR /f "tokens=1-4 delims=/ " %%a in ('date /t') do (set mm=%%a& set dd=%%b& set yyyy=% %c& (if "%%a:~0,1" gtr "9" set mm=%%b& set dd=%%c& set yyyy=%%d))
echo Todays date in Windows format is: %date%
set mydate=%yyyy%-%mm%-%dd%
echo 'Current Date': %mydate%
rem The following is not needed unless you have specific requirements to strip characters, etc
:: rem Remove leading Zeros from Day
:: set d=%dd%
:: set /a d=100%d% %% 100
:: rem Remove leading Zeros from Month
:: set m=%mm%
:: set /a m=100%m% %% 100
:: set snapshot=%d%-%m%-%yyyy%
set snapshot=%mydate%
echo 'Latest Snapshot': %snapshot%
@echo "Current Date","Latest Snapshot"> %FileName%
@echo "%mydate%","%snapshot%">> %FileName%
rem **************************************************************
set AnaplanUser=“XXX@anaplan.com"
set WorkspaceId=“XXX”
set ModelId=“XXX”
:: This variable AC_exe should be set to the path of the AnaplanClient.bat
set AC_exe=D:\Anaplan\AnaplanClient.bat
:: This variable Cert should be set to the path of your Anaplan User's Certificate (can be downloaded from Anaplan under user profile on the top right)
set Cert="D:\Anaplan\certificate-XXXX.cer"
:: This variable LogPath should be set to the path of a folder/directory for the Anaplan Connect log files
set LogPath="D:\Anaplan\logs"
set Operation=-certificate %Cert% -file "CurrentDate.csv NOTE: This is the filename in the Anaplan Model when you click on Import Data Sources button" -put %FileName% -import "Import Current Date NOTE: This is the name of the Import Action in the Anaplan Model" -execute -output %LogPath%
rem *** End of settings - Do not edit below this line ***
setlocal enableextensions enabledelayedexpansion || exit /b 1
cd %~dp0
if not %AnaplanUser% == "" set Credentials=-user %AnaplanUser%
set Command=%AC_exe% %Credentials% -s %ServiceLocation% -workspace %WorkspaceId% -model %ModelId% %Operation%
@echo %Command%
cmd /c %Command%
pausesave it with .bat extension and you can use it.
The actual code was in the other post.
I've made it available here. Thank you!
0
Categories
- All Categories
- 2.3K Anaplan Community
- Academy
- Anaplan Talent Builder
- Model Design Course
- The Anaplan Way
- Archive
- 2 Idea exchange
- 62 Enterprise Scale
- 1.1K Extensibility
- 21 Intelligence
- 1.6K Planning & Modeling
- 331 Security
- Community Connections
- Connections
- Experiences
- Groups
- Personas
- Employees
- CS Toolkit
- Customer Care Center
- Forums
- Academy & Training
- Community Feedback & Updates
- Japan
- Anaplan Community Japan
- Anaplan Community Japan Knowledge Base
- HyperCare Japan
- JP-Central
- Support-Japanese
- Partners
- Partner Leadership Council
- Partner Product Council
- 724 Platform
- Anapedia
- App Hub
- Centers Of Excellence
- Extensions
- Planual
- Platform Updates
- 724 User Experience
- Profile Builder
- Resources
- Anaplan Advocates
- Anaplan Live!
- Community
- Community Advancement
- Community Connections
- Partner Program
- The Official Master Anaplanner Program
- Videos
- Welcome to the Anaplan Community!
- Success Central
- Support
- Case Portal Link
- Common Support Questions
- HyperCare Redirect
- Known Issues and Workarounds
- Support test page
- SupportFAQ
- Survey
- 2 Training Day Takeaways