-
Returning same value from same Line Item but different items
Hi all,
Is it possible to return a value from an item on the same line item? For example, picture this as my module:
I want to be able to calculate a delta between S1 and S2 or S3 and S1, like this:
Here I'm using SELECT but this will be a lookup since I want the user to be able to select which scenarios he want to compare, of course this formula won't work because this is a circular reference, is there a way to make it work?
The user wants to have a Delta on the same table as the scenarios, that's why I'm not creating a second module to calculate it.
-
Date Line Item using Min Summary
Hello
I am using line item formatted as date with 6 level hierarchy. I am using summary as Min for the same.
I am facing issues where if there is no date in my list P6, i am getting 12/31/2399 for all NonBlank list members. Please advise best way to handle it without doing any hardcoding.
Regards
MO
-
Add note / comment out in the formula editor
Ability to add notes / comment out formula parts in the formula editor similar to '- -' in SQL or ' in Microsoft Visual Basic
-
Inquiry Regarding Zero Chunk Count in Anaplan Integration API V2 Downloads
I am currently working with the Anaplan Integration API V2 to download a list of files and obtain their corresponding file IDs. In previous downloads, the chunk count for the files was correctly indicated. However, I have noticed that the chunk count for the same files now shows as zero, despite no changes being made to the model or files in Anaplan.
This discrepancy in the chunk count is preventing me from downloading the files as expected. Could you please provide some insights into why the chunk count has suddenly become zero? Additionally, why is Anaplan not allowing us to determine the appropriate chunk size for downloading files? Any guidance on resolving this issue would be greatly appreciated.
-
Email Notification
I created a action - to add list member. Additionally also a notification to notify me via email if there will be a new List member added. But unfortunately it is showing me two different buttons to execute the process. Is there any way i can create in one process the adding of list member followed by Email notification?
Thanks in Advance.
-
Automate model copy
Is there a way to schedule or automate the process of copying a model?
-
Need to know if we can take out some GB from 1 workspace and put that space into different workspace
Hi,
I have a question where I want to split out like 30 GB from one of my workspace and put that 30 GB into different workspace.
Current Situation
Workspace 1= 130 GB
Workspace 2= 300 GB
Required Situation
Workspace 1 = 160 GB
Workspace 2= 270 GB
If its possible how can we do this.
Thanks
-
Enhancing Your Anaplan Audit History Reporting with Model History Export
We are excited to announce a significant upgrade to the existing Anaplan Audit History Reporting project written in Python. This project now includes the ability to export Model History. This enhancement provides a more comprehensive view of data changes within your Anaplan models, allowing for deeper analysis and better archiving capabilities.
Key Features:
* Inclusion of Model History Export: The Anaplan Audit History Reporting has been upgraded to include Model History Export. This new feature ensures that all changes in data within individual Anaplan modules are tracked and exportable.
* Tracking Changes: Anaplan Model History meticulously records all data changes in individual Anaplan modules, offering a detailed log that is essential for auditing and reviewing historical data modifications.
* Flexible Export: The export functionality dynamically updates the export column names in a SQLite table. This flexibility ensures compatibility and ease of integration with various data processing workflows.
* Offloading to Robust Databases: For enhanced analysis and archiving, it is recommended to offload the exported data to a more robust relational database. This approach facilitates extensive data analysis and long-term storage, ensuring your data is accessible and secure.
* Using the New Feature: To utilize this new feature, set up an Anaplan Export Action and save the Export Action from the Model History interface. The export action must be named "MODEL_HISTORY_EXPORT". Once this action is configured, the model history will be dynamically exported to a new table created in the SQLite database where the Python script executes. The table and column names will be slightly modified to ensure they are SQL-friendly.
Step-by-Step Instructions:
* Set Up Anaplan Export Action:* Navigate to the Model History interface in your Anaplan model.
* Set up, save, and run the Export Action
* Execute the Audit History Export Script:* When the current Audit History export process is run, the Python script automatically detects any Export Action named "MODEL_HISTORY_EXPORT" in a given Module.
* On the first run, once the model history has been downloaded, the script will dynamically create a new table in the SQLite database and ensure all column names are SQL-compatible.
Note: The table and column names may differ slightly as the script will modify all Workspace, Model, Module, and Line Item names to be "SQL Compatible".
* On subsequent runs, the SQL table may include additional columns as other Modules are included in the Model History.
Note: Similar to the Audit History Export, it is important to run the Model History Export frequently, such as every 24 hours, to ensure the output is up-to-date.
* Deployment Instructions:* For detailed deployment instructions, please follow the guide provided in this link.
* Please be advised that this continues to be considered a custom solution and, as such, is not directly supported by Anaplan Support.
Conclusion: By incorporating the Model History Export into your Anaplan Audit History Reporting, you gain a powerful tool for tracking, analyzing, and archiving data changes within your Anaplan models. This feature enhances the audit capabilities and ensures that your data management processes are robust and flexible.
For further details and to start using this feature, visit the Anaplan Community Discussion.
Author: Quin Eddy, @QuinE - Director of Data Integration, Operational Excellence Group (OEG)
-
How to create in a module a quarter option?
Hello,
I have a forecast module, with monthly TimeScale and I want to create, in this module, an option for a quarterly view. So basicly, if the client wants to see the data quarterly, he should be able.
I also have a MOD02 Quarter Time Settings and also a filter module for the quarter part.
At this moment, my data is being taken from other modules and each line has a lookup formula. Example :
Forecast = ModelA.Data[LOOKUP: ' MOD01 Lookups Seetings.Forecast, Lookup:' MOD01 Lookups Seetings.AMOUNT].
Is there a way to make this formula optional for quarter view? Client should be able to choose from the UX page the year, the Quarter (if he wants) and then the month. AT this moment, he is able to choose only year and month.
Thanks
-
Introducing Improved Anaplan DX: a browser extension for Anaplan Modelers
We at valantic are excited to share our latest development: Improved Anaplan DX, a browser extension designed to enhance your modeling experience and increase efficiency. Please see below for more details. The extension is now available in the Chrome Web Store (can be installed on Chrome and Edge):
https://chrome.google.com/webstore/detail/improved-anaplan-dx/fijomfhflcgocncnbncehfckehdbbmnd
For any feedback, suggestions, bugs, or general enquiries, please do not hesitate to contact us at: anaplan-integration@ba.valantic.com.
Here's how the Improved Anaplan DX enhances your model building experience:
1. Keyboard Shortcuts: Say goodbye to the mouse! We've added an extensive set of keyboard shortcuts that cover almost all actions in Anaplan. From navigating modules to editing line items, you'll be amazed at how quickly you can accomplish tasks with just a few keystrokes, without continuously having to swap between mouse and keyboard.
2. Page and Report Analysis: Need to find all pages referencing a particular module? Or want to identify which line items are used as filter variables in your pages and reports? Our extension has you covered! With a keyboard shortcut, you can quickly locate and analyse critical dependencies, enabling you to make informed decisions about your models.
3. AI-powered Formula Assistance: Imagine having an AI-powered assistant right in the formula editor, just like Co-pilot for developers. With our integration of ChatGPT, you'll have access to intelligent suggestions, code snippets, and contextual guidance as you write your Anaplan formulas. This powerful feature will help you become even more efficient and accurate in your modelling.
4. Formula Editor Enhancements: We've supercharged the formula editor to make creating and editing formulas a breeze. Hovering over items or functions now provides helpful tooltips, ensuring you have all the information you need at your fingertips. Additionally, our validation and error highlighting feature help catch potential issues before you even submit your formulas, saving you valuable time and reducing frustrating wait periods.
5. Enhanced Popup Windows: We've taken the annoyance out of popup windows in Anaplan. Our solution makes them focus traversable (you can navigate the window with Tab), allowing for seamless navigation within popups. We have also added styling to these elements, so you always know which one you have currently selected. You can also reach the enter button with tab and confirm your changes in all popups now.
You can customise the extension by turning most features on or off in the extension settings.
Brought to you by
https://www.valantic.com/en/business-analytics/connected-planning-with-anaplan/
-
Transfoming Numbers
Hello,
I am trying to get the figures from Eur in KEur. The figures in Eur they are in a Module and if I just apply the classic formula, I will increase the size of my Module as I need them both : in Keur and in Eur (I don't want that).The figures in KEur I need to show them in the UX, so I am searching for a way to show this without dubleing the size of my module.
Thanks
-
[Part 1] Enhanced Reporting of the Anaplan Audit Log Summary
As organizations continue to embrace Anaplan's powerful platform for connected planning and decision-making, maintaining robust security and compliance measures has become increasingly essential. The Anaplan Audit Log serves as a critical tool in achieving these objectives, providing granular insights into user activities and data changes within the platform. However, unlocking the full potential of the audit log and utilizing it effectively for reporting purposes presents its own set of challenges.
The primary purpose of this article is to explore these challenges and offer practical solutions to help organizations overcome them, thereby enabling them to harness the power of the Anaplan Audit Log for comprehensive reporting and analysis. By addressing the complexities associated with audit log reporting, organizations can strengthen their security posture, improve compliance, and enhance overall operational efficiency.
Efficiently fetching and formatting the audit log data for reporting purposes can be a complex and time-consuming task. In this article, we will explore the Anaplan Audit History Python project available on GitHub that automates the process of fetching Anaplan audit history, transforming it into a meaningful and reportable format, and loading the data into an Anaplan Reporting Model. Data that is captured includes user identification, the timestamp of the activity, the specific event type, and a description of the action taken. This data is recorded in a consistent and structured format, making it easy to filter, sort, and analyze.
By leveraging the power of Python, organizations can save valuable time, enhance reporting capabilities, and uncover valuable insights from their audit log data. The following diagram illustrates the process:
Next, learn how to deploy this solution by reading the second installment of this series: [Part 2] Enhancing Anaplan Audit Log Data Extraction with Streamlined Python Solutions.
Author: Quin Eddy, @QuinE - Director of Data Integration, Operational Excellence Group (OEG)
-
Using the Anaplan Certificate with the Anaplan REST API: A Comprehensive Guide
If you're diving into integrating with the Anaplan REST API using an Anaplan Certificate, you'll need to know certain requirements. This post is a step-by-step guide to ensure a seamless connection using Python. If you'd prefer to avoid a programmatic approach to using your certificate, then please check out the CA Certificate Auth Generator.
Requirements for Using Anaplan Certificate with REST API:
* Making a POST Call:
Initiate a POST call to https://auth.anaplan.com/token/authenticate.
* Adding a Header:
The Connection header key should encapsulate the Anaplan public key with the string CACertificate followed by a space and the entire Anaplan public key:
Connection: CACertificate MIIFeDCCBGCgAwIBAgIQCcnAr/+Z3f... (continues)
* Pass a Random String:
Incorporate a 100-byte random string of data within the body of the REST API call. Here is an example of a 100-byte random string:
codeJlkj3$9kds*lKD09jlkjasD9021!lsjd2309sdlsjLJDSJfdi21l3ekds92jLJSFdfDJSld3i0d9flsjd3
* Sign the String and Format the Body:
This random string has to be signed using the certificate's private key. When you're preparing the body of your API call, it should have this structure:
{
"encodedData": "ACTUAL_ENCODED_DATA_VALUE",
"encodedSignedData": "ACTUAL_SIGNED_ENCODED_DATA_VALUE"
}
Note: The placeholders ACTUAL_ENCODED_DATA_VALUE and ACTUAL_SIGNED_ENCODED_DATA_VALUE need to be substituted with the genuine values that you get from encoding and signing your data. The curly braces themselves remain unchanged.
* PEM Format:
Both the Public Certificate and the Private Key must conform to the PEM format. PEM, standing for 'Privacy Enhanced Mail,' is the go-to format for saving and transferring cryptographic keys, certificates, and other forms of data. It's easily recognizable due to its delimiters (-----BEGIN CERTIFICATE----- and -----END CERTIFICATE-----) for public certificates and (-----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY-----) for private keys.
A Handy Python Implementation:
To make things more practical, here's a Python script to help generate the mandatory strings for encodedData and encodedSignedData:
from base64 import b64encode
from Crypto.PublicKey import RSA
from Crypto.Random import get_random_bytes
from Crypto.Signature import pkcs1_15
from Crypto.Hash import SHA512
import json
# Generate the encodedData parameter
def create_encoded_data_string(message_bytes):
# Step #1 - Convert the binary message into Base64 encoding:
# When transmitting binary data, especially in text-based protocols like JSON,
# it's common to encode the data into a format that's safe for transmission.
# Base64 is a popular encoding scheme that transforms binary data into an ASCII string,
# making it safe to embed in JSON, XML, or other text-based formats.
message_bytes_b64e = b64encode(message_bytes)
# Step #2 - Convert the Base64-encoded binary data to an ASCII string:
# After Base64 encoding, the result is still in a binary format.
# By decoding it to ASCII, we get a string representation of the Base64 data,
# which is easily readable and can be transmitted or stored as regular text.
message_str_b64e = message_bytes_b64e.decode('ascii')
return message_str_b64e
# Generate the encodedSignedData parameter
def create_signed_encoded_data_string(message_bytes, key_file, passphrase):
# Step #1 - Open the private key file for reading:
# Private keys are sensitive pieces of data that should be stored securely.
# Here, we're reading the private key file from the disk using Python's file I/O functions.
key_file_content = open(key_file, 'r', encoding='utf-8').read()
# Step #2 - Import the RSA private key:
# The RSA private key is imported from the previously read file content.
# If the key is encrypted, a passphrase will be required to decrypt and access the key.
my_key = RSA.import_key(key_file_content, passphrase=passphrase)
# Step #3 - Prepare the RSA key for signing operations:
# Before we can use the RSA key to sign data, we need to prepare it using
# the PKCS#1 v1.5 standard, a common standard for RSA encryption and signatures.
signer = pkcs1_15.new(my_key)
# Step #4 - Create a SHA-512 hash of the message bytes:
# It's common practice to create a cryptographic hash of the data you want to sign
# instead of signing the data directly. This ensures the integrity of the data.
# Here, we're using the SHA-512 algorithm, which produces a fixed-size 512-bit (64-byte) hash.
message_hash = SHA512.new(message_bytes)
# Step #5 - Sign the hashed message:
# Once the data is hashed, the hash is then signed using the private key.
# This produces a signature that can be verified by others using the associated public key.
message_hash_signed = signer.sign(message_hash)
# Step #6 - Encode the binary signature to Base64 and decode it to an ASCII string:
# Similar to our earlier function, after signing, the signature is in a binary format.
# We convert this to Base64 for safe transmission or storage, and then decode it to a string.
message_str_signed_b64e = b64encode(message_hash_signed).decode('utf-8')
return message_str_signed_b64e
def create_json_body(encoded_data_value, signed_encoded_data_value):
data = {
"encodedData": encoded_data_value,
"encodedSignedData": signed_encoded_data_value
}
return json.dumps(data, indent=4)
# create random 100 byte message
message_bytes = get_random_bytes(100)
# Provide path to the private key in the PEM format
private_key_file = './quin_eddy_private.key'
# Provide the private key passphrase. If there is no passphrase, please insert None
private_key_file_passphrase = None
# Create the encoded data string
message_str_b64e = create_encoded_data_string(message_bytes=message_bytes)
# Create an encoded signed data string
message_str_signed_b64e = create_signed_encoded_data_string(
message_bytes=message_bytes, key_file=private_key_file, passphrase=private_key_file_passphrase)
# Get the formatted body for the Anaplan API token authentication endpoint (https://auth.anaplan.com/token/authenticate) to generate an access_token
certificate_api_body = create_json_body(
encoded_data_value=message_str_b64e, signed_encoded_data_value=message_str_signed_b64e)
print(certificate_api_body)
This script employs the PyCryptodome library for the signing process. If you haven't done so already, make sure to install it:
pip install pycryptodome
That's all there is to it! Adhering to these guidelines and using the shared script, your integration with the Anaplan REST API via an Anaplan Certificate should be a breeze.
It is not hard. Please take a look at this short demonstration using Postman to login to Anaplan using the encoded and signed strings:
Authors: Quin Eddy, @QuinE & Adam Trainer, @AdamT - Operational Excellence Group (OEG)
-
Level 2: Model Builder - 3.3.5.2 Inventory Ordering Module Formulas
Hi everyone,
I am not getting the results as expected. Does anyone of you know where my mistake is?
* for the first Row "Beginning Inventory" I am only getting values for Week 1.
* For row "Shipping Time Weeks" I am getting 0 as the result. But expected is the value 4 (for Week 1).
Here are my formulas:
Thank you.
KR Tobi
-
Transactional APIs - Part 2: Use Cases
* Introduction
* Following use cases will be presented in this section:
* How to retrieve id for a given dimension/list & list member from its name or code
* How to retrieve allocated & consumed space for a Workspace & Model
* Workspace Sizing Use case
* Model Memory Usage Use case
* How to retrieve permitted number of Items & Index Count for Numbered Lists
* Make updates to Model Calendar using transactional API
* Update Current Fiscal Year
* Update Current Period
This article follows our Part 1 - Transactional APIs, the basics; we are taking it up a notch and are going technical; we encourage you to be familiar with Transactional APIs when you go through this content.
For an overview of Anaplan APIs, go here.
Disclaimer: Scripts provided with this article are for reference only. They are not production grade and are not supported by Anaplan. They are provided to illustrate examples of different integration use cases using Anaplan APIs.
Target Audience: Integration Developers
Pre-requisites:
* Familiarity with following:
* REST, Python scripting, Anaplan API, Anaplan Modeling concepts.
* Anaplan authentication token is generated.
* Scripts provided were tested on Python v3.8.2
Introduction
In this section, we will address Transactional APIs that allow you to gather model metadata. We will present different use cases that will benefit from using Transactional APIs. Sample Python scripts will be used to illustrate power of transactional APIs in model maintenance & management.
Following use cases will be presented in this section:
* How to retrieve id for a given dimension/list & list member from its name or code.
* How to retrieve allocated & consumed space for a Workspace & Model.
* How to retrieve permitted number of Items & Index count for numbered lists.
* Make updates to Model Calendar using transactional API.
* How to update Fiscal Year for a model.
* How to set current period for a model.
* Set a new version (EA)
* Update switchover period (EA).
How to retrieve id for a given dimension/list & list member from its name or code
Transactional data API call enable users to work with model data (saved view) without using Actions. For example, using Transactional API, you are able to read data from a saved view. An API request to query a saved view with page selectors may look something like:
https://api.anaplan.com/2/0/models/{modelId}/views/{viewId}/data?pages={dimensionId:itemId}&format=v1
In order to make this API request, you will need to gather ids for the model, view, dimension, and item. This means, you will likely need to make four different API calls to get a list of all dimensions, for examples, and parse through the JSON response to get the id you are interested in. Imagine doing this for every time you need to build a query. Wouldn’t it be convenient to create a simple python script you can use that returns an id based on a name or a code? You will learn how this is done using transactional APIs.
Following API endpoint can be used to retrieve all the lists and their ids in a specified workspace and model:
https://api.anaplan.com/2/0/workspaces/{workspaceId}/models/{modelId}/lists
Headers:
* Authorization: AnaplanAuthToken {anaplan_auth_token}
* Accept: application/json
transGetListIdFromName.py
A sample python script (transGetListIdFromName.py) is provided with this article, that can help you retrieve a list Id from a list name. This script takes three arguments at the command line: workspaceId, modelId, and a list name. It returns list name associated with the list name.
python transGetListIdFromName.pay {workspaceId} {modelId} {List Name}
transLookupItemIdFromName.py
You can also look up item id from name or code. Python script transLookupItemIdFromName.py retrieves list item Id from a list member name. This script takes three arguments at the command line: workspaceId, modelId, & listId. It returns list name associated with the list member name. List member name can be provided in the script for the variable item_name. ListId can be obtained using the script described above (transGetListIdFromName.py).
python transLookupItemIdFromName.py {workspaceId} {modelId} {listId}
transLookupItemIdFromCode.py
You can also look up item id from name or code. Python script transLookupItemIdFromName.py retrieves list item Id from a list member code. This script takes three arguments at the command line: workspaceId, modelId, & listId. It returns list name associated with the list member name. List member name can be provided in the script for the variable item_code. ListId can be obtained using the script described above (transGetListIdFromName.py).
python transLookupItemIdFromCode.py {workspaceId} {modelId} {listId}
Note: Anaplan authentication token is hard coded into these scripts.
Prior to executing the script, you will need to update the value for anaplan_token in the script. Ideally, you would want to create a separate function to generate the token and pass the value of the token to the API request dynamically. For illustration purposes, we will focus on transactional API functionality. Details on how to generate authentication token via APIs can be found in our CA Certs Best Practices article here.
How to retrieve allocated & consumed space for a Workspace & Model
Do you want to monitor your workspaces and models for their size and take appropriate action when they reach a certain threshold? Do you have a need to monitor index count for numbered list before it reaches a max of 1,000,000,000? Transactional metadata APIs is your answer.
Transactional metadata APIs provide insights into Workspace and Model information. This information can be used to populate a dashboard in Anaplan that monitors key metrics regarding Workspace/Model size, current index count for a numbered list, etc. This section presents instructions and sample script(s) to gather these insights that can be loaded into a model.
Let’s take a scenario where we would like to monitor following:
* Workspace Size
* Model Memory Usage
* Current Index Count for a list
Workspace Sizing Use case
Let’s say we want to report on a list of all workspaces within our default tenant. We would also like to report on allocated space and consumed space for each workspace in our tenant.
Transactional metadata API endpoint with parameter tenantDetails=true will return a list of all workspaces in a tenant. It also returns additional workspace metadata that includes workspaceId, name, sizeAllowance (bytes), and currentSize (bytes). API call would look something like:
Headers
Authorization : AnaplanAuthToken {anaplan_auth_token}
transGetWorkspaceSizeInfo.py
A sample python script, transGetWorkspaceSizeInfo.py, provided with this article returns a list of Workspaces in your default tenant with Allocated Size and Current Size for each workspace. To use this script, you will need to update the script with Anaplan authentication token.
Model Memory Usage Use case
Let’s say we would like to understand how much memory is being used by a model in a given workspace. Using transactional API, you can retrieve a list of all models and each model’s memory usage with in a given workspace in your default tenant.
Transactional metadata API endpoint https://api.anaplan.com/2/0/workspaces/{workspaceId}/models with parameter modelDetails=true will return a list of unarchived (“UNLOCKED”) models in a given workspace and available model usage in bytes. If modelDetails is set to false or not defined, API call will not return the model memory usage information. API call would look something like:
https://api.anaplan.com/2/0/workspaces/{workspaceId}/models?modelDetails=True
Headers
Authorization : AnaplanAuthToken {anaplan_auth_token}
transGetModelSizeInfo.py
A sample python script, transGetModelSizeInfo.py, provided with this article returns a list of models in a selected workspace in your default tenant along with available memory usage information in bytes & MB for each model. It will also return number of models in selected workspace. To use this script, you will need to update the script with Anaplan authentication token.
How to retrieve permitted number of Items & Index Count for Numbered Lists
Each list item has an index. The maximum value for a list item index is 999,999,999. The next item index represents the index of the next new item. Subsequent imports can fail if your organization works with large amounts of data and the maximum value is reached. You can reset the Next item index if:
* You’re a workspace administrator
* The list item index of the selected list is between 899,999,999 and 999,999,999
* The select list does not contain any items. (source: Anapedia).
Using transactional API, Retrieve list metadata, you can setup automated monitoring of list item index value. You can, optionally, setup notification alerts when the index value reaches a certain threshold so you can take appropriate action such as resetting the index. There is an API endpoint available to reset the index. Endpoint to retrieve list metadata is as follows:
https://api.anaplan.com/2/0/workspaces/{workspaceId}/models/{modelId}/lists/{listId}
Headers:
* Authorization : AnaplanAuthToken {anaplan_auth_token}
* Accept : application/json
* Content-Type : application/json
Among other information, this API endpoint will return two pieces of information regarding index count:
* permittedItems: Indicates how many more items you can add to the existing list. This value changes when the number of items in the list change.
* nextitemIndex: This applies to only numbered list. It returns the index of the next new item in the numbered list.
Two sample python scripts, transGetItemIndexCountInfo.py & transGetItemIndexCountInfoNList.py are provided with this article to illustrate how this endpoint can be used to monitor available number of list members and next item index value.
transGetItemIndexCountInfo.py returns number of permitted items in a standard list. It requires three input arguments: workspaceId, modelId, and listId.
python transGetItemIndexCountInfo.py {workspaceId} {modelId} {listId}
transGetItemIndexCountInfoNL.py returns two pieces of information: number of permitted items and next item index in a numbered list. It requires three input arguments: workspaceId, modelId, and listId (numbered list).
Make updates to Model Calendar using transactional API
Updating time dimension for all the models in a workspace, each planning cycle, can be a daunting task. Thanks to transactional APIs, you are now able to automate updating of Current Fiscal Year and Current Period via a script (ex: python).
In this section, we will present API endpoints (with sample Python scripts) that will facilitate updates to Current Fiscal Year & Current Period in Time settings of a model.
Update Current Fiscal Year
There are two API endpoints allow you to work with Current Fiscal Year in a model:
* Retrieve Current Fiscal Year using GET method
* Set Current Fiscal Year using PUT method
Let’s examine API details to set current fiscal year in a model.
URL:
https://api.anaplan.com/2/0/workspaces/{workspaceId}/models/{modelId}/modelCalendar/fiscalYear
Headers:
* Authorization : AnaplanAuthToken {anaplan_auth_token}
* Accept : application/json
* Content-Type : application/json
Body
{“year”:“{fiscal year}”}
transSetCurrentFiscalYear.py script can be used to, programmatically, set Current Fiscal Year in a model. This script has three input arguments: workspaceId, modelId, & newFiscalYear (ex: FY23).
Example:
Python transSetCurrentFiscalYear.py 8a81b09d5e8c6f27015ece3402487d33 35A6EF893D7F47EEA5A554D5CC7DC330 FY23
Update Current Period
There are two API endpoints allow you to work with Current Period in a model:
* Retrieve Current Period using GET method
* Set Current Period using PUT method
Let’s examine API details to set current period in a model.
URL:
https://api.anaplan.com/2/0/workspaces/{workspaceId}/models/{modelId}/modelCalendar/currentPeriod?date={new_curr_period}
Headers:
* Authorization : AnaplanAuthToken {anaplan_auth_token}
* Accept : application/json
* Content-Type : application/json
transSetCurrentPeriod.py script can be used to, programmatically, set Current Period in a model. This script has three input arguments: workspaceId, modelId, & newCurrentPeriod (ex: 2023-07-21).
Example:
Python transSetCurrentPeriod.py 8a81b09d5e8c6f27015ece3402487d33 35A6EF893D7F47EEA5A554D5CC7DC330 2023-07-21
Now, let's move on to Part 3 and Data Virtualization.
Got feedback on this content? Let us know your thoughts on the comments below.
Contributing authors: Joey Morisette, Christophe Keomanivong, and Pavan Marpaka.https://api.anaplan.com/2/0/workspaceshttps://api.anaplan.com/2/0/workspaces?tenantDetails=true
-
How to get Range of Values between two Booleans that are time formatted?
When the user select Two Boolean Check the range is defined so I want to get the range of values respective months.
-
Query on Efficient List Creation Method
I'm seeking advice on the quickest method for creating lists in Anaplan: using the UX Page "Form action" or the backend Actions for Creating List Item. Which approach is more efficient?
-
ALM syncing when multiple developments are happening
We have 2 developers working on the same model in different modules.
One has completed his changes but the other is not ready to sync.
Unfortunately you have to sync the whole model, and this means partial changes would then be synced. If the first developers' changes are urgent, waiting for a major change to be finished is unproductive.
Would it be an idea to just sync the changes (by choice), and not the whole model?
-
modify email notifications?
My client is sending a email notification and there is some weird formatting things in the notification pop up: it shows Recipient and no space between Recipient and the email address. Also, the Recipient context doesn't align, it steps down. It looks messy. Is there anyway to make changes so it looks neater and more readable?
Screenshot 2023-12-13 at 12.20.54 PM.png
-
How does Authentication with CA Certs work?
Why CA Certs?
The purpose of this blog series is to give a deeper look on the use of Certificate Authority (CA) Certificates, especially on how this method of authentication works and how to use them for your different integrations.
A Quick Recap On Anaplan APIs Authentication
We recommend our readers to have some basic knowledge on Anaplan APIs.
In order to be able to trigger Anaplan actions remotely, one will need to get authenticated to the API server. If the authentication process is successful, the user will be granted a token that can be used for a limited period of time to activate Anaplan actions. The biggest challenge is to be able to get that token from the certificate you have.
Why would you use CA Certs instead of the well-known "basic authentication", involving the user email and password?
There are 2 main drawbacks of using basic authentication.
1. Critical information easily accessible
When using basic authentication, one will have to use username and password in the development of the integration process. Very often, this information is in clear text for any person who will have access to the scripts.
2. Regular update of credentials
Anaplan's password policy requires that any credentials must be updated at least every 3 months. The team in charge of integration will then be required to amend the scripts frequently, which increases the maintenance workload.
By using CA certs, we want to address those 2 concerns that are frequently raised by teams in charge of integration.
How does CA Cert based authentication work under the hood?
Sometimes, a schema is a great tool for understanding. So here is one:
Anaplan's cert-based method follows PKI basic principles, especially the rules of asymmetric cryptography.
Out of CA certificate, one will extract a private key and the public certificate. To have a thorough description of the steps needed to achieve this extraction, please use this link with a very instructive and interactive guide.
The private key will be used to "sign" a random string, generated externally for that purpose. Anaplan API server will receive this random string and its signed version. Via a specific calculation, it will validate if those two strings are related to each other using a private key's signature linked to the public certificate. Once the check is validated, the authentication process can be sure that the person who has sent the information is in possession of a valid private key.
So why is that method more secure than using Basic Authentication?
Based on what has been described above, we can state that:
* As you could see in the previous part, certificate information decoding requires a minimum of technicality to be handled correctly.
* No private or confidential information is sent on the web.
* There is also another advantage, quite consequential: The integration based on CA Certs will remain valid until the end of the certificate validity. Hence, there is no need to have a regular maintenance of integration scripts.
Anaplan also adds another level of security: to authorize API actions triggering via certificates, public certificate needs to be registered in the tenant admin.
In the case that we want to deactivate a certificate, you can simply do it via this screen. This will be without any consequence on the actual user linked to the certificate.
What about the private information?
One concern can be made on the use of the private key. Indeed, that piece of information is critical and private. Then, it cannot be handled lightly and should not be easily accessed.
Nevertheless, when analyzing the diagram flow, we can see that no private information is passed through the web. Only the 2 strings and the public certificate are sent through the web.
In your integration, nothing prevents you from reusing this pair of strings and store the private key in a secure location. By doing so, you will be compliant with the necessity to secure sensitive information.
Now, let's compare 2 situations, both involving a person with bad intents.
* Situation 1: Credentials have been retrieved
In this situation, an authorized person, in possession of Anaplan credentials, can log in into Anaplan and have access to sensitive information stored in Anaplan Platform.
* Situation 2: Cert-based information (2 strings + public cert) have been retrieved
In this case, an authorized person can trigger APIs; However, the unauthorized person will have no access to other parts of Anaplan interface and functionality. The access is more limited than with the actual credentials.
Now, you'd also want to ensure that those strings aren't also too easily readable. Please visit to learn how to create the strings securely.
https://community.anaplan.com/discussion/156392/integrating-securely-using-the-anaplan-rest-api-with-certificate-based-authentication
-
Issue in LIS where one line item is shown as a parent of another.
Hi,
I have created a LIS from two different modules with a total of 3 line items. The two line items I selected from the first module however are having a parent child relationship when I use the LIS as a dimension in another Module. This should not be the case as all the line items are independent.
Q1.jpg
Q2.jpg
The First Image is the LIS, second image is the module where the LIS is being used as a dimension, in the row.
-
Assigning List item based on Text line items and looking up - COMPLEX
Hi Community,
To give the backstory of this - I have a module, where I first import one data file into, with Loan-Hedge ID List) and line items as the dimensions. The second file I import is a similar one, also with Loan-Hedge ID (List) and line items as the dimensions.
When importing the first file, these Loan-Hedge IDs will have a Stock Symbol assigned to them, and will also show their assigned Hedges, as Loan-Hedge ID, coming in on the Hedged ID column, as text. In the three columns to the left, named Hedge 1, Hedge 2, and Hedge 3, I basically separate them out individually from the Hedged ID column.
Essentially, what I'm trying to do, with a formula, is to populate the hedges with their associated Stock Symbol if the cell is empty.
Below is the end result I'm trying to achieve:
To note: in blue is the dimension of the column, and in yellow is the format of the column.
If needed, more line items can be added to make it easier.
I really hope the community can help me with this!
Thank you!
-
Ability to Apply Filters before downloading Model History
Currently, If I want to check history to view some activity on a specific module or list, but I am not aware of the dates when that change took place, It takes forever for me to extract the history for downloading 'ALL' change history and locate that change. I face issues especially when the changes are too many and file is too huge. It would be best for me if I can filter by module, list and user before downloading.
-
[Part 2] Enhancing Anaplan Audit Log Data Extraction with a Streamlined Python Solution
The Anaplan Audit History project, consisting of several Python modules and a configuration file, works synergistically to streamline the process of fetching, formatting, and loading Anaplan audit log data into a preconfigured Anaplan Model. The project leverages the Anaplan REST API, the Python Pandas library for efficient data conversion from web services JSON format to tabular, and SQLite for advanced data blending and transformation capabilities.
SQLite, a highly versatile and lightweight database engine, offers substantial benefits for transforming and blending various related datasets. Its capacity to execute complex SQL queries and join operations enables users to merge datasets in diverse ways, establishing itself as a powerful tool for data integration and enrichment. Utilizing SQLite's comprehensive set of built-in functions, the project seamlessly combines multiple Anaplan datasets and performs data transformation operations such as filtering, sorting, and reshaping within the SQLite environment. The simplicity of SQLite's file-based storage system facilitates easy deployment and management directly within the Python code, making SQLite an efficient, scalable, and accessible solution for data blending, transformation, and summarization. In context to this project, this SQL code combines various Anaplan metadata, including Users, Workspaces, Models, Actions, Processes, and CloudWorks Integrations via an SQL join with the raw audit data to synthesize audit data in a reportable format.
In order to supply all this Anaplan content, the following Anaplan REST APIs need to be leveraged:
* OAuth Service API - to authenticate and refresh the access_token based on the client_id and refresh_token.
* Authentication API - to authenticate and refresh theaccess_tokenbased on a valid username and password combination or valid certificate in the PEM format.
* Audit API - to fetch the audit records.
* Integration API - to fetch metadata about Anaplan objects such as data sources, Processes, and Actions. Additionally, to refresh content to the target Anaplan Audit Reporting Model, the bulk API is used to upload the report-ready audit data, and the transaction API is leveraged for updating the latest timestamp.
* SCIM API - to fetch Anaplan user metadata.
* CloudWorks API - to fetch CloudWorks integration metadata.
This project exemplifies how Python can effectively integrate and automate Anaplan operations, using modern OAuth services for Anaplan authorization in tandem with the rich capabilities of the Anaplan REST API. Additionally, the project highlights several Python best practices, such as:
* Organizing code into packages and modules: Segmenting the code into multiple modules based on functionality improves maintainability and simplifies the process of locating and resolving future issues.
* Enhancing error handling: Effective error management is vital when working with external APIs. Implement try-except blocks to handle exceptions that may occur during API calls or file I/O operations.
* Utilizing Python's logging module: Opt for the built-in logging module instead of print statements for debugging, providing better control over log verbosity and streamlining log output management.
* Leveraging environment variables or configuration files: Avoid hardcoding sensitive information like API keys or credentials and store this information using environment variables or configuration files instead.
* Adding comments to the code: Include annotations in complex or non-obvious code sections to improve comprehensibility for both yourself and others.
Anaplanners can use this project as a basis for building tailored integrations.
The source code and supplementary details, such as requirements, deployment instructions, and helpful videos, are available on GitHub.
Next, learn how to use this data in an Anaplan Model by reading the third installment of this series: [Part 3] Anaplan Audit History Data in an Anaplan Reporting Model.
Author: Quin Eddy, @QuinE - Director of Data Integration, Operational Excellence Group (OEG)
-
Integrating Securely: Using the Anaplan REST API with Certificate-Based Authentication
In the ever-evolving landscape of technology, secure communication between platforms is paramount. The Anaplan REST API offers a robust way to connect and interact with the Anaplan platform, and one of the most secure methods of authentication is through certificate-based authentication. In this article, we'll delve into the process of using the Anaplan REST API with certificate-based authentication, exploring the concepts and techniques involved.
1. Understanding Certificate-Based Authentication
Certificate-based authentication involves the use of a digital certificate and private key to establish trust between parties. In the context of Anaplan's REST API, this method ensures a secure connection while exchanging data. Learn more about how Authentication with CA Certs work as well as view the Authentication Service API documentation. If you need a certificate, then please check out the CA Certificate Quick Start Guide using Sectigo.
2. PEM Format: The Key to Success
Before we delve into the authentication process, it's essential to ensure that your public certificate and private key are in the PEM (Privacy Enhanced Mail) format. This widely used format ensures compatibility and security during data exchange.
3. Authentication API Request Structure
To generate the authentication token, your API request should have the appropriate header and body components:
Header: Include your public certificate (.pem), encoded in base64.
Body: Comprises a JSON structure containing two strings.
* encoded_string: A randomly generated string of at least 100 bytes, encoded in base64.
* Encoded_signed_string: This string is the "encoded_string" signed by your private key and then base64 encoded.
Here's an example of the JSON structure for the request body:
{
"encodedData": "2wiKPoVqz0ZheVU8T+CqoR82WsVfDIb3bc...",
"encodedSignedData": "hnbAWqqOob5RrAlqMyLbuUvkpK0Bfe9hm3Ml..."
}
4. The Role of Base64
Base64 encoding is crucial in this process, as it converts binary data into a printable text format. This transformation enables the secure transport of data over protocols or mediums that might not handle binary data formats.
5. Ensuring Secure Communication
The combination of base64-encoded data and the certificate-based authentication method guarantees secure communication with the Anaplan platform. This is especially important when dealing with sensitive information.
6. Approach 1: Simple Browser-Based Solution
For an effortless way to generate the required strings, you can use our downloadable RSA Signer in a handy downloadable ZIP file. Once the files have been downloaded and unzipped, open the index.html file. You are then presented with an interface that allows you to paste your public certificate and private key. It then generates the necessary encoded strings, which you can directly use in your API request (i.e. Postman).
RSA Signer.zip
Note: The RSA Signer.zip must be extracted/unzipped first with both files contained in the same directory after extraction.
Note: The RSA Signer currently does not support ENCRYPTED private keys (keys encrypted with a pass phrase). Decrypt the key using a tool like OpenSSL first before generating the auth strings in the RSA Signer.
7. Approach 2: Python Implementation
If you prefer a programmatic approach, here's a link to a comprehensive guide to using the Anaplan Certificate with Python to generate the required strings for your Anaplan API request. This solution is compatible with Python 3.11.1 and later versions.
https://community.anaplan.com/discussion/156606/using-the-anaplan-certificate-with-the-anaplan-rest-api-a-comprehensive-guide
8. Incorporating Certificates with Anaplan: A Productive Endeavor
As organizations strive for tighter security and efficient integration, certificate-based authentication emerges as a dependable solution. By implementing the methods discussed in this article, you'll be better equipped to seamlessly and securely connect your systems with the Anaplan platform.
Incorporating certificates into your Anaplan integration can appear complex, but armed with the knowledge of these two approaches, you're well on your way to a more secure and streamlined integration process. Stay ahead in the world of secure communication and data exchange with Anaplan's REST API and certificate-based authentication.
Authors: Quin Eddy, @QuinE & Adam Trainer, @AdamT - Operational Excellence Group (OEG)
-
[Part 3] Anaplan Audit History Data in an Anaplan Reporting Model
With Anaplan Audit, Enterprise and Professional level Customers can track audit events that occur in their Anaplan tenant.
For the Anaplan Audit History project, we created a simple Anaplan reporting model and app to report on Anaplan Audit events in the Anaplan UX.
Customers may download and use the Anaplan Audit Model & App in their Customer tenant. The standalone Anaplan Audit model consists of a single Anaplan model with a small number of lists, modules, actions, processes, and user experience pages. Customers are able modify and maintain their Audit Model as they see fit.
Once connected to the Python integration described in Part 2, Customers may schedule daily updates from the SQLite tables. The model update process consists of a single Anaplan process that imports new audit data as text into a flat ‘Audit’ module. SUM and COUNT functions sum over audit event frequencies by Audit activity category into an ‘Audit Report’ module. A ‘Refresh Log’ module is dimensionalized with a batch ID dimension that captures timestamps of every model update as well as record counts. These three modules are displayed on UX pages.
The Anaplan model is ~2MB at download, but will grow over time as the number of unique audit records increases based on the volume of activity in a Customer’s tenant. Customers may therefore need to periodically archive older audit data to maintain desired model size.
Audit Logs are available to members of the Tenant Auditor role via either the Administration UI or via the Audit API. The Anaplan Tenant Admin assigns members of the Tenant Auditor Role. Audit logs are available through the Admin console or the REST API for 30 days.
Please reach out to your Anaplan Customer Success Business Partner or Representative to obtain your Model copy. The Anaplan Audit Model is not supported by Anaplan and is used at Customer’s own discretion.
See Part 1 and Part 2 of Anaplan Audit History Data in an Anaplan Reporting Model.
-
Anaplan History Extraction based on Specific Criteria
Hi Anaplan Team,
We now only have one option for extracting history: selecting a date range. It will benefit all model builders and Anaplan workspace admin users who truly take part in model development if we can offer more options, filters, or criteria.
History Extraction Options along with Data Range:
based on a specific user.
based on specific objects like modules, lists, line items, and so on.
-
Event Registration - API Developer Virtual Meetup
Hi All
Our first event for 2023 is right around the corner!
Agenda:
* Welcome and Intro
* Update from the Anaplan team
* Demo
* Q&A
Event times:
* AMER/EMEA: 25th July 09:00-10:00 (PDT)
* APAC/EMEA: 26th July 13:00-14:00 (SGT)
* We will record the sessions for those who cannot make the times listed
Registration Steps:
Register here ⇒ https://calendly.com/adamtrainer
Upon navigating to the above link, you will be directed to a page like the below:
* Select an event coinciding with your timezone
* Select a date from the calendar
* Select a time
* Click "Next"
* Enter your name and email address
* Click "Schedule Event"
* You will be sent a calendar invite with the zoom meeting link attached
If you have any questions, please let me know.
Looking forward to meeting you in the sessions!
Regards
@AdamT
-
Upcoming Event Dates - Demo volunteers
Hi all
We're planning a virtual event for 25th/26th of July (invites to be sent soon).
We're seeking for volunteers that would like to demo a solution they've built that incorporates the Anaplan APIs. The demo should be around 15-20 min.
Please send me a direct message with your interest in presenting your solution to the group.
Cheers
Adam
-
Schedule automated Anaplan notifications
As a Page Builder/Integration Administrator, I'd like to be able to schedule Anaplan native UX notifications. This would allow me to send native (instead of email) notifications to a set of users (hard-coded or lineitem-driven) about a predefined page. I'd like to be able to have different scheduling options, each being at hour and minute of:
* everyday
* every working day
* nth day of every month (with negative values interpreted as last days of month)
* nth day of every week
* nth day of nth week of a month
* nth working day of every month (with negative values interpreted as last days of month)
Native notifications are great, much better than normal emails with links, and implementation of this idea would allow me to:
* notify people at the same time via email, mobile app and web interface, taking an user directly to the right page;
* set predefined schedules aligned with business processes;
* avoid 3rd party software and complicated integrations for simple use cases of time-based workflows.
I think the best way would be to add an extra option in CloudWorks (which is already able to send emails - about status of integration's execution).