Hey
I have a complex model involving several dimensions.
I have prices uploaded in specific junctions, however the quantities of possible combinations is endless.
The measure price "PRC" is set as average for all dimension.
The model structure priority is set on measures.
I wanted to issue out the last booked price out of the uploaded data (on jan 2024).
which I successfully did when I used several "FOREACH.BOOK" as below:
CONFIG.GENERATE_UNBOOKED_DATA=OFF MEMBERSET[d/Date]=%02_P_DATE% TO %03_P_DATE% MEMBERSET[d/Measures]="PRC" MEMBERSET[d/ACC_GP]="SLS_DRCT" FLOAT @LAST_PRICE // last price FOREACH.BOOKED[d/CUSTOMER],[d/PROD] FOREACH.BOOKED[d/MAT_GRP],[d/_USE] FOREACH.BOOKED[d/CURRENCY],[d/SALES_ORG] FOREACH.BOOKED [d/Date] IF RESULTLOOKUP([d/Measures]="PRC", [d/ACC_GP]="SLS_DRCT") > 0 THEN @LAST_PRICE=RESULTLOOKUP([d/Measures]="PRC", [d/ACC_GP]="SLS_DRCT") DATA([d/Measures]="PRC", [d/ACC_GP]="SLS_DRCT",[d/Date]="202401",[d/AUDIT_ID]="#")=@LAST_PRICE ENDIF ENDFOR ENDFOR ENDFOR ENDFOR<br>

the problem is that the DA run for more than 6 minute and tends to crush.
but if I take out those multiplied FOREACH.BOOKED, the DA works for few seconds but the results are completely wrong as below:
CONFIG.GENERATE_UNBOOKED_DATA=OFF MEMBERSET[d/Date]=%02_P_DATE% TO %03_P_DATE% MEMBERSET[d/Measures]="PRC" MEMBERSET[d/ACC_GP]="SLS_DRCT" FLOAT @LAST_PRICE // last price //FOREACH.BOOKED[d/CUSTOMER],[d/PROD3] //FOREACH.BOOKED[d/MAT_GRP],[d/_USE] //FOREACH.BOOKED[d/CURRENCY],[d/SALES_ORG] FOREACH.BOOKED [d/Date] IF RESULTLOOKUP([d/Measures]="PRC", [d/ACC_GP]="SLS_DRCT") > 0 THEN @LAST_PRICE=RESULTLOOKUP([d/Measures]="PRC", [d/ACC_GP]="SLS_DRCT") DATA([d/Measures]="PRC", [d/ACC_GP]="SLS_DRCT",[d/Date]="202401",[d/AUDIT_ID]="#")=@LAST_PRICE ENDIF ENDFOR // ENDFOR ENDFOR ENDFOR<br>


is there a better way to do it?
Thanks
Deb