Identifying orphans in a composite hierarchy for deletion
Hi,
I have an L2 list that is used to capture staging data. The parent to this list is L1.
The user runs a import action via the UX and a csv file to load serial numbers into the L2 list (L2 is a numbered list)
The user has been provided a template to upload the L2 list wherein they need to enter the parent and that is subsequently mapped in the import action. So all L2s end up having legit L1 parents.
In the event the parent does not exist in the system but in the file, the action fails, which is the desired behavior.
But this also consecutively creates a lot of orphans outside the L1 hierarchy since the parent does not exist.
A blueprint of the hierarchy for reference
- L2 child
- L2 child
L1 - L2 child
- L2 child
L1
All (Top level of L1) - Orphan 1
- Orphan 2
- Orphan 3
The idea is to delete these orphans so as to not create unnecessary members in the L2 list.
I went about creating a property module on L2 to identify the ones that do not have an L1 parent. The idea was to use this boolean in deletion that I can run at the very end of the import process.
When I create a property module, all these orphans do not appear in the dimension itself coz of which I am unable to identify them.
Is there another workaround to this?
Thank you very much.
Best Answers
-
Can I assume you have a line that's a boolean with a format of 'L2', with no version or time with a formula of ISBLANK(PARENT(ITEM('L2')))?
If so, it should just be a case of creating a delete from list action using that boolean and that should be it.
The property module you're using.. is this by a subset, or by the full L2 list? A subset could potentially impact this as the orphaned L2s may not get included, thus not show up.
0 -
I am guessing you have selective access on the list, and your access is set to the Top level. Since the top level does not include these orphans, they are not shown in the module for you.
Depending on the scope you can just highlight and manually delete them, or you will have to give yourself selective access to the orphaned children in the list for them to show in the module.
Again depending on scope of the model and the frequency, I might look to change how this load happens, and first load to a staging area to validate the data is correct before pushing it to your list. That way it would catch in a list that might not have selective access on it which would be significantly easier to work with and safer so youre not adding failed list members to your list.
1
Answers
-
Thank you @luke_e and @jasonblinn for your responses.
Yes, I did have selective access on the list and my access was set to Top level owing to which I could not view the orphans in the module.
I created a boolean to be passed to the delete action and added that to the process to avoid unnecessary orphans in the import that populates the list. The delete runs at the very end in the process.
So if the parent does not exist in Anaplan but exits in user file, the import action would fail coz of parent not existing and the delete action removes the created orphans to maintain a neater list.
0