Home - Board Community
Home
Forums
Platform
Assigning new codes to existing Entity members
John-Paul Baar
Board 10.x question:
We have about 200 existing entity members across three Entities which require new codes due to changes in the source system. E.g. 12 Apples with code 12 will now have a code of 0010 - the member/description is the same but just has a new code. The existing members are referenced by Procedure selections, Rules and Entity Format templates and the Entities are referenced in over 250 cubes (although mostly not at the lowest level of granularity - they are a higher level in a hierarchy).
Loading them as new members will require a change in many places as well as an increase in the Max Item Nr which will require all the cubes to be exported and reimported (this will take about 9 hours).
I had thought of editing the codes directly in advance of the data load but there are too many of them and it will be error prone.
Any ideas?
------------------------------
Jean-Paul Baar
Systems Analyst
Capitec Bank
South Africa
------------------------------
Find more posts tagged with
Accepted answers
All comments
Pietro Ferrari
Hello Jean-Paul,
you really only have two options, either manually change the codes or make an extract/clear/load.
If it's really 200 codes to change I would go for a manual change. It might be a tedious task but if you do have a lot of saved selections, entity formats and so, this will be your safest option and very likely also the fastest way to get it done.
In the Entity members edit you can use the search function, then ctrl-c/crt-v to paste the new code. If you have your table with old-new codes in an excel table it should not take more than an hour to do the job and you won't have to worry about any kind of impact anywhere in your existing capsules and procedures. You're right saying this is error prone but this is really a single point of risk, once that is done and verified you don't even need to look at other parts of your solution.
The approach with extract/clear/reload has many more
- the moment you clear your entity you will lose your saved formats on the entity, so you will have to redefine them later,
- before extracting your entity, set the sort to "none" so that members are exported in creation order and after reload the saved selection will remain valid,
- you need a way to replace the old/new code in the file, preserving the order of members
- note that if you have even made any manual deletion of entity members, after reload you will probably not have your select/referto still valid because deleted members will not be extracted and after reload you will have some "shifts".
One note on the MaxItemNr, if an entity is not used at physical level of any cube, then you can change it without clearing the entity because the MaxItemNr comes into play only when an entity is used to physically reference data. If an entity is only used to aggregate on the fly, then the MaxItemNr can be changed without any impact of left undefined (zero).
Another approach, though I don't think is applicable in your case, would be to create a new entity as parent of the current entity. Then populate the current entity with the new and old codes (12 Apples and 0010 Apples) and the parent only with the new codes (0010 Apples), then relate the old and new to the new (12 and 0010 both related to 0010 in the parent entity). This approach I think is not good in your case because you'd have to change your selections, referto and entity format, the advantage here would be to preserve the old code.
Hope that helps,
Pietro
------------------------------
-------------------------------------------
John-Paul Baar
Thanks Pietro for the detailed feedback.
I'm sure, in this situation, the entity is not at the lowest granular level of any cube so it appears we may have more flexibility.
Editing them manually will be quite tedious - we have Dev, QA and Prod environments and the application is spread across two databases with this particular entity replicated on both. So I am really trying to avoid this!
If we do not have to clear any cubes then I think re-formatting the entity templates would be easier compared to manually editing the members. So perhaps I could extract, clear, find/replace and then reload just the entity preserving the "none" sort order. Might this work? And would the issue regarding deleted member be an issue if we were not reloading cubes?
I also noted that Rules do not get updated even if you manually edit the codes. But at least you can export/import Rules so I would only have to do this once.
Thanks
Jean-Paul
------------------------------
John-Paul Baar
Systems Analyst
Capitec Bank
South Africa
------------------------------
-------------------------------------------
Quick Links
📢 Community Guides
📘 Board Knowledge Base
⭐ Best Practices
✍ Community Experience Survey
📑 My Bookmarks
💬 My Discussions
🤝 Groups