How to replace previous list with new list

Highlighted
Contributor

How to replace previous list with new list

Hi,

 

How can I replace my existing list with new one so that D4 should not appear in the list. why i am raising this question is because when I am importing the new list, D4 is still appearing in it which is actually not in the new list, kindly advise:

Existing List

CatA:

 - D1

 - D2

 - D3

CatB:

 - D4

 - D5

 

New List:

CatA:

- D1

- D2

- D3

CatB:

- D5

5 REPLIES 5
Highlighted
Certified Master Anaplanner

Re: How to replace previous list with new list

Hi @sharmagh 

Until and unless, the previous item D4 is deleted from the list before you run the import action, it will remain in the list. Question is how to identify that D4 is not there in the updated file. 

One approach is to delete all content of the second list before you do the import. But that has a risk of losing data associated with D5.

The other approach (a bit roundabout) is to identify from the source data if an item exists in the new data set or not. Create a module with one line item called initialise (can be formatted as anything you want, preferably text). Populate that as blank before you run the import. Once you run the import, populate the line item against the list to identify which of the items exist. You can simply populate this by the list item name itself. If some items don't exist, use a delete process after the import is run to delete them from the list.

Thanks
Anik
Highlighted
Community Boss

Re: How to replace previous list with new list

IMPORTING doesn't delete

you need to manage deletion yourself.

If you can't simply wipe out data,then you will need a staging list.

 

Say your list is named L1, you'll name your staging L1 Staging and here's the process:

1: Clear all items in L1 Staging (with the clear from list using selection action)

2: Import the data in L1 Staging

3: In a module, you can compare L1 staging items and L1. If an item is not in L1 staging but in L1, mark it true

4: Import data in L1

5: use this boolean to clear these items from L1 using "clear from list using selection action"

6: Put all of these into a process, which you can run

 


Nathan Rudman, Anaplan Model Builder
Highlighted
Contributor

Re: How to replace previous list with new list

@nathan_rudman 

Thanks for the reply, only one question i have is that assuming i am using time scale in my module (monthly) so when i delete my previous list and upload the new one will my prior months data remain their or i will lose it also.

Highlighted
Frequent Contributor

Re: How to replace previous list with new list

Hi Sharmagh,

 

Using clear from list using selection action , you might lose the data in modules where that list is being used as dimension.

These is one more workaround, where in you can create a subset in that list and replace this subset with list in that respective modules.

But here you need to update the main list whenever there are new entries through an import action and then update the subset list through import action/manual (if there are few entries).

To update subset list through import ,the list members should be defined by True/False in another column in the source file.

 

Hope this helps.

 

~Abhi

Highlighted
Super Contributor

Re: How to replace previous list with new list

hi @sharmagh 

 

This is because D4 is already a member of the CatB list, if you load the new file, it either updates new entries or updates any matching entries, it wouldnt delete any list item in the list even if you upload a blank file , in order to do update you need to set a delete action first, you can do using a boolean and then delete using selection action and then perform the import