Exporting Flat Lists from Saved View from the Hub to Spoke Model and Create Hierarchy


Dear Community,


I am building 4 flat lists in the Hub as below. L4 is the lowest level, L3 is L4's parent, L3 is L2's parent and L1 is L2's parent.  The next step would be to create saved views to build Level 1 to Level 4 in the spoke model based on the parent - child relation assigned below.


Do I need to build a separate module in the Hub dimensionlized with each list (e.g. one module for L1, one for L2, one for L3 and one for L4) in order for the export to work properly?  Would it be possible to just use the below one module to create all four levels? I am getting a lots of errors for duplicated records when I try to create L2 using just the below. 



Many thanks,



Best Answer

  • jasonblinn
    Answer ✓


    You can just use the L4 Module that you have set up. I would recommend creating line items that show the first occurrence of each level so that you can create a filter. ISFIRSTOCCURRENCE() can be found here: https://help.anaplan.com/anapedia/Content/Calculation_Functions/All/ISFIRSTOCCURRENCE.htm


    From there, create a saved view for ;

    - L1 showing the L1 line items, filtered on the First occurrence of L1

    - L2 showing the L2 line items, L1 for the parent, filtered on the First occurrence of L2

    - L3 showing the L3 line items, L2 for the parent, filtered on the First occurrence of L3

    - L4 showing the L4 line items, L3 for the parent, filtered on the First occurrence of L4


    Then in your spoke model, you can run 4 imports, one from each saved view, and only have the records in the saved views that you need to build the hierarchy. 


    Let me know if it would be helpful to see a mockup of this.



  • Thank you so much Jason!!! This is eye opening and super awesome! 


    In addition to Jason's detailed explanation, I found the below is a good support of Jason's solution! 




    Rule #2
    Use a Saved View

    The first part of any import (or export) is retrieving the data. The time it takes to open the view directly affects the time of the import or export.

    • Always import from a saved view—NEVER from the default view. And use the naming convention for easy maintenance.
    • Ensure the view is using optimized filters with a single Boolean value per axis.
    • Hide the line items that are not needed for import; do not bring extra columns that are not needed.
    • If you have done all of the above, and the view is still taking time to complete, consider using the Tabular Multi Column export and filter "in the way out." This has been proven to improve some sluggish exports. 

    Rule #3
    Mapping Objective = Zero Errors or Warning

    Make sure your import executes with no errors or warnings as every error takes processing time. The time to import into a medium-to-large list (>50k) is significantly reduced if no errors are to be processed.

    • In the import definition, always map all displayed line items (source→target) or use the "ignore" setting. Don't leave any line item unmapped.