Load Data (Master and Analytic Models)
  • 3 Minutes to read
  • Dark
    Light
  • PDF

Load Data (Master and Analytic Models)

  • Dark
    Light
  • PDF

Article summary

Load Data (Master and Analytic Models)

Use this API to import data to a Master or an Analytic model. Incremental data loads are supported. Invoke Clear Data API to clear all data in the model before the data import if an incremental data load is not needed. Use additional parameters to have a success or failure notification emailed to you.

Additional options described below include:

  • Optionally allowing data to continue to load even when dimension members are missing

  • Optionally adding missing dimension members

  • Optionally receiving notification upon success and failure of the data load

POST /modeling/model/data/load HTTP/1.1
Content-Type: application/xml
Accept: application/xml
X-ACCESS-TOKEN:
 
<?xml version="1.0" encoding="UTF-8"?>
<load-data-payload>
<model-name>$ModelName</model-name>
<delimiter>$Delimiter</delimiter>
<aggregate-flag>$AggregateFlag</aggregate-flag>
<continue-on-error>true</continue-on-error>
    <add-missing-dimension-members>true</add-missing-dimension-members>
    <missing-dimension-members>
    <entry>
        <key>dimensionname</key>
        <value>rollupname</value>
    </entry>
    </missing-dimension-members>     
<page-dimensions>
<entry>
<key>$PageDimension</key>
<value>$PageMember</value>
</entry>
	...
</page-dimensions>
<column-dimensions>
<entry>
<key>$ColumnNumber</key>
<value>$ColumnDimension</value>
</entry>
	...
</column-dimensions>
<column-members>
<entry>
<key>$ColumnNumber</key>
<value>$DimensionMember</value>
</entry>
	...
</column-members>
<notify-on-success>
<email>email1@domain</email>
<email>email2@domain</email>
</notify-on-success>
<notify-on-failure>
<email>email1@domain</email>
<email>email2@domain</email>
</notify-on-failure>
<data-records>
<data-record>$Data</data-record>
	...
</data-records>
</load-data-payload>

Parameters

  1. $ModelName: Name of the model

  2. $Delimiter: Data delimiter

  3. $AggregateFlag: “True” will aggregate data whenever duplicates are found. “False” will replace data when duplicates are found

  4. $PageDimension: Dimension on page

  5. $PageMember : Dimension member on page

  6. $ColumnNumber: Column number that represents dimension/member on the column

  7. $ColumnDimension: Dimension on column

  8. $DimensionMember: If a Dimension on a row is expanded, include all expanded members and corresponding column numbers

  9. $Data: data separated by delimiter

Sample Payload

<?xml version="1.0" encoding="UTF-8"?>
<load-data-payload>
<model-name>LoadModelTest</model-name>
<delimiter>|_|</delimiter>
<aggregate-flag>true</aggregate-flag>
<continue-on-error>true</continue-on-error>
    <add-missing-dimension-members>true</add-missing-dimension-members>
    <missing-dimension-members>
    <entry>
<key>Products</key>
<value>Laptops</value>
</entry>
</missing-dimension-members>
    <page-dimensions>
<entry>
<key>Measures</key>
<value>MTD</value>
</entry>
<entry>
<key>Scenario</key>
<value>Budget</value>
</entry>
</page-dimensions>
<column-dimensions>
<entry>
<key>1</key>
<value>Products</value>
</entry>
<entry>
<key>2</key>
<value>Time</value>
</entry>
<entry>
<key>3</key>
<value>Time</value>
</entry>
<entry>
<key>4</key>
<value>Time</value>
</entry>
<entry>
<key>5</key>
<value>Time</value>
</entry>
<entry>
<key>6</key>
<value>Time</value>
</entry>
<entry>
<key>7</key>
<value>Time</value>
</entry>
<entry>
<key>8</key>
<value>Time</value>
</entry>
<entry>
<key>9</key>
<value>Time</value>
</entry>
<entry>
<key>10</key>
<value>Time</value>
</entry>
<entry>
<key>11</key>
<value>Time</value>
</entry>
<entry>
<key>12</key>
<value>Time</value>
</entry>
<entry>
<key>13</key>
<value>Time</value>
</entry>
</column-dimensions>
<column-members>
<entry>
<key>2</key>
<value>Jan</value>
</entry>
<entry>
<key>3</key>
<value>Feb</value>
</entry>
<entry>
<key>4</key>
<value>Mar</value>
</entry>
<entry>
<key>5</key>
<value>Apr</value>
</entry>
<entry>
<key>6</key>
<value>May</value>
</entry>
<entry>
<key>7</key>
<value>Jun</value>
</entry>
<entry>
<key>8</key>
<value>Jul</value>
</entry>
<entry>
<key>9</key>
<value>Aug</value>
</entry>
<entry>
<key>10</key>
<value>Sep</value>
</entry>
<entry>
<key>11</key>
<value>Oct</value>
</entry>
<entry>
<key>12</key>
<value>Nov</value>
</entry>
<entry>
<key>13</key>
<value>Dec</value>
</entry>
</column-members>
<notify-on-success>
<email>john.doe@mycompany</email>
</notify-on-success>
<notify-on-failure>
<email>john.doe@mycompany</email>
<email>jane.doe@mycompany</email>
</notify-on-failure>
<data-records>
<data-record>HP1|_|10|_|10|_|10|_|10|_|10|_|10|_|10|_|10|_|10|_|10|_|10|_|10</data-record>
<data-record>Dell1|_|10|_|10|_|10|_|10|_|10|_|10|_|10|_|10|_|10|_|10|_|10|_|10</data-record>
<data-record>Lenovo|_|20|_|20|_|20|_|20|_|20|_|20|_|20|_|20|_|20|_|20|_|20|_|20</data-record>
<data-record>Pixel 2|_|20|_|20|_|20|_|20|_|20|_|20|_|20|_|20|_|20|_|20|_|20|_|20</data-record>
<data-record>Nexus 6|_|30|_|30|_|30|_|30|_|30|_|30|_|30|_|30|_|30|_|30|_|30|_|30</data-record>
<data-record>iPhone 7|_|40|_|40|_|40|_|40|_|40|_|40|_|40|_|40|_|40|_|40|_|40|_|40</data-record>
</data-records>
</load-data-payload>
Note:
The recipient of the data load will receive an email titled "Data Load Success with exceptions" along with the exceptions detailing what went wrong.

Additional Information on Data Load Notifications

You can optionally include two sections for success and failure email notifications.

Notify on Success

<notify-on-success>
<email>email1@domain</email>
 	<email>email2@domain</email>
</notify-on-success>
Notify on Failure

<notify-on-failure>
<email>email1@domain</email>
<email>email2@domain</email>
</notify-on-failure>
Note:
Success and failure notifications will only be sent to registered users. Add users in the application before including the users in the email notifications.

Additional Information on Missing Leaf Dimension Members and Continue on Error

This is an optional configuration to continue data loading even when there are missing leaf dimension members. If this option is configured, then the data load API will continue to load the valid data and will notify users with the list of missing leaf dimension members for which data has not been loaded.

This flag in the Data Load API continues to load data even when an Invalid member or Invalid number is encountered.

<continue-on-error>true</continue-on-error>

This optional flag in the Data Load API adds missing leaf dimension members, if any, to the corresponding dimension in the Master and Analytic Model Data Load API, and then loads the data.

<add-missing-dimension-members>true</add-missing-dimension-members>
Note:
To add missing leaf dimension members, the <continue-on-error> property must be set to true.

Additionally, you can specify where the additional leaf dimension members should be added.

<missing-dimension-members>       
<entry>       
 <key>dimensionname</key>       
 <value>rollupname</value>       
</entry>       
</missing-dimension-members>

Insert the <entry> ... </entry> section for each dimension that you want to specify where new members should be added.

Use Case 1:

This will continue the data load even if there are any missing leaf dimension members or invalid numbers found in the data load and will only load the data with the valid dimensions members.

<continue-on-error>true</continue-on-error>

Use Case 2 :
This will continue the data load even if there are any missing leaf dimension members or invalid numbers found in the data load. Then it adds missing leaf dimension members to the corresponding dimensions and loads the data.

<continue-on-error>true</continue-on-error>
        
<add-missing-dimension-members>true</add-missing-dimension-members>

Use Case 3:

This will continue the data load even if there are any missing leaf dimension members or invalid numbers found in the data load. Then it will add missing leaf dimensions members to Dimension1Name and Dimension2Name and will load the data.

Note:
<missing-dimension-members> ... </missing-dimension-members>

This section is optional. If this item is not included, the missing leaf dimension members will be added to DLR_DimensionName, if it exists. Otherwise DLR_DimensionName is created and the additional leaf dimension members are placed there. This occurs in each corresponding dimension with new members.


Was this article helpful?