on 2023 Oct 12 2:23 PM
Dear all,
I have to try to copy data from specific members of a dimension to members of the same dimension based on an attribute in the dimension.
The member of the source dimension has the same id as the property.
An explicative table is shown here:
Step 1:
Insert the value in the table only for Product.Segment = X
The dimension is formed like this:
Final result:
I tried writing these codes, but it didn't work. Do you have any ideas?
MEMBERSET [d/Account] = ("GSR_VAT")
//DATA([d/Products]=[d/Products].[p/Segment])=RESULTLOOKUP()
// DATA([d/Products]=[d/Products].[p/Segment]) = RESULTLOOKUP([d/Measures]="FINAL_PERC")
// DATA([d/Measures]="FINAL_PERC", RESULTLOOKUP([d/Products].[p/Segment])) = RESULTLOOKUP([d/Products],[d/Measures]="FINAL_PERC")
Thanks
andreagaleandro
() around IF not required. It was not there in my initial post but I copied and it got carried over.
Try the below , I am assuming you have an attribute segment with value "X"
MEMBERSET [d/Account] = "GSR_VAT"
MEMBERSET [d/Measures] = "FINAL_PERC"
FOREACH [d/Products]
IF [d/Products].[p/Segment])!="X" THEN
DATA()=RESULTLOOKUP([d/Products]=[d/Products].[p/Segment])
ENDIF
ENDFOR<br>
OR, I removed the IF and ENDIF and moved it to member set. Here you can try removing for and end for
MEMBERSET [d/Account] = "GSR_VAT"
MEMBERSET [d/Measures] = "FINAL_PERC"
MEMBERSET [d/Products].[p/Segment])!="X"
FOREACH [d/Products]
DATA()=RESULTLOOKUP([d/Products]=[d/Products].[p/Segment])
ENDFOR
Br.
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
andreagaleandro
Sorry it was a typing error and bad formatting as i have typed on my phone
MEMBERSET [d/Account] = "GSR_VAT"
MEMBERSET [d/Measures] = "FINAL_PERC"
FOREACH [d/Products]
IF ([d/Products].[p/Segment])!="X" THEN
DATA()=RESULTLOOKUP([d/Products]=[d/Products].[p/Segment])
ENDIF
ENDFOR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
andreagaleandro
andreagaleandroIt should be as below. You can try removing FOREACH also and see if it works
MEMBERSET [d/Account] = "GSR_VAT"
MEMBERSET [d/Measures] = "FINAL_PERC"
FOREACH [d/Products]
IF [d/Products].[p/Segment])!="X" THEN
DATA()=RESULTLOOKUP([d/Products].[p/Segment])
ENDIF
ENDFOR
Br.
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nikhil
I tried adding the code you pointed out, even trying to remove the foreach but it always gives me this error
With Foreach
MEMBERSET [d/Account] = "GSR_VAT"
MEMBERSET [d/Measures] = "FINAL_PERC"
FOREACH [d/Products]
IF ([d/Products].[p/Segment])!="X" THEN
DATA()=RESULTLOOKUP([d/Products].[p/Segment])
ENDIF
ENDFOR
Without ForeachMEMBERSET [d/Account] = "GSR_VAT"
MEMBERSET [d/Measures] = "FINAL_PERC"
IF ([d/Products].[p/Segment])!="X" THEN
DATA()=RESULTLOOKUP([d/Products].[p/Segment])
ENDIF
Best Regards
Andrea
User | Count |
---|---|
57 | |
10 | |
7 | |
7 | |
6 | |
6 | |
5 | |
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.