Can Anaplan Connect with batch scripts append data?

kartiendasolventoph
edited August 2023 in Modeling

Hello, I'm using Anaplan Connect with batch scripts to integrate data into my Anaplan models. I'm interested in understanding whether Anaplan Connect supports the ability to append data to existing records in the models. Could you please provide information or guidance on achieving data appending using batch scripts in Anaplan Connect? I'm looking to ensure that the historical data in the model is preserved while updating and exporting specific data points. Any insights or references to relevant documentation would be greatly appreciated. Thank you

Tagged:

Answers

  • Hi,

    Anaplan Connect behaves in same way as you would be loading in the file manually to Anaplan. So as by default functionality Anaplan overwrites possible previous values if those exists in Anaplan before hand. If you don't want to change these data points you would need to exclude those from your import or you should build a logic in Anaplan that stores the correct values for you from the import.

  • Thank you @pyrypeura . Question again, how do you do incremental data loading in Anaplan using batch scripts?

  • hendersonmj
    edited August 2023

    In Anaplan, Import actions can only replace existing values, not accumulate.

    Let's say your line item is named "Value".
    As a workaround, you could add three line items "Incremental Load Value", "New Total Value", and "Zero". Give them these formulas:
    New Total Value = Value + Incremental Load Value.
    Zero = 0
    Incremental Load Value = <blank … no formula>

    Revise your data import action to put new values into Incremental Load Value.

    Next, create a view and import action that import New Total Value into Value and that import Zero into Incremental Load Value. The second part clears the incremental load so those doesn't hang around to double up on the next data load run.

    Be aware that incremental loads can be messy … if something goes wrong mid-stream, you don't want it to continue as though everything were fine. In Anaplan Connect, I have written a more advanced script that checks for successful completion of the first data upload action before running the copy-and-clear action. This requires capturing a log file (redirecting the stdout and stderr of the line that calls AnaplanClient.bat), then reading that log to look for the expected success message. If no success message is found, don't continue on to run the later copy-and-clear action. This does require some scripting skills … all of mine come from stackoverflow.com ;-).