cancel
Showing results for 
Search instead for 
Did you mean: 

Copy from a member to an attribute of the same dimension on SAP Analytics Cloud (SAC)

andreag412
Explorer
0 Kudos
626

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

Accepted Solutions (1)

Accepted Solutions (1)

N1kh1l
Active Contributor
0 Kudos

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

andreag412
Explorer
0 Kudos

Thanks a lot

Andrea

Answers (2)

Answers (2)

N1kh1l
Active Contributor
0 Kudos

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
andreag412
Explorer
0 Kudos

Now there is no error and the validation is also ok.

It just says that the date action cannot be saved

No other explanation is given

Andrea

N1kh1l
Active Contributor
0 Kudos

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

andreag412
Explorer
0 Kudos

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 Foreach
MEMBERSET [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