on 2024 Oct 03 10:49 AM
I have a Product dimension which has 2 hierarchies, PL6 and PL7. The hierarchy is something like this. I want to move the data from hierarchy PL6 level to PL7 but only to the first product in PL7 hierarchy. I'm trying to do it with the below code using FOREACH. It is moving the data to all the products in the PL7. [p/SKUPL6] is the attribute which has the connection between PL7 AND PL6 hierarchies. Each product at PL7 level has this attribute SKUPL6 which has the value for PL6 under which it belongs to. I'm trying to use FOREACH to move data from PL6 for each iteration to PL7 and then delete the product if SKUPL6 = null.. As SKUPL6 only has values for PL7 products and for PL6 products this attribute is blank. The below code is copying data for all products below PL6 but not deleting PL6 value within the FOREACH. I'm trying to delete the PL6 value so it only copies the value for the first product and for the next product it will have no value in PL6 to copy below.
How can I achieve this?
As you already have the connection of PL6 and PL7, I assume probably you don't need FOREACH loop at all.
Maybe you can try something as below:
CONFIG.HIERARCHY = [d/PRODUCT].[h/L7]
MEMBERSET [d/PRODUCT].[p/SKUPL6] != " "
DATA() = RESULTLOOKUP([d/PRODUCT] = [d/PRODUCT].[p/SKUPL6] )
DELETE([d/PRODUCT] = [d/PRODUCT].[p/SKUPL6])
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
10 | |
9 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.