Skip to Content

looping through with logic script

Hi Experts,

We are using NW 10 version.

I have a COGS Model which has BOM Itemization for each SKU(Finished good), stored at Version=REL.

SKU Rawmaterial UoM Qty Amt

252 00023 KG .4 22

252 0024 Ltr .8 44

Also, I have sales data coming from APO module and loaded against each SKU(FG) under SAL_VOL metric dimension.

SKU UoM Qty

252 KG 2000

Now, I have to multiply the SKU APO Qty with each of the BOM components of the SKU so that the result is written to a new record of the same dimensions members.

SKU Rawmaterial UoM Qty Amt

252 00023 KG .4*2000=800 22*2000=44000

252 0024 Ltr .8*2000=1600 44*2000=88000

So, first I want to scope the records with SAL_VOL to get APO Sales Qty and

then loop through each SKU to multiply with the BOM components of that SKU

and finally write that to a new record.

I have tried the logic script as follows, but not able to know how to loop it through.

*XDIM_MEMBERSET METRICS=SAL_VOL

*XDIM_MEMBERSET VERSION=BUDV0_2014

*SELECT(%SKU_SET%,"[ID]",PRODUCT_SKU,"[CALC]='N'")

*XDIM_MEMBERSET METRICS=VOL

*XDIM_MEMBERSET VERSION=REL

*WHEN PRODUCT_SKU

*IS *

*REC(EXPRESSION=%VALUE%*%SKU_SET%)

*ENDWHEN

I get the validation error.

Help please.

Regards,
Draksharam

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Dec 30, 2013 at 04:06 AM

    Hey Draksharam,

    Probably you would like to try triggering your calculations from Volume/Qty Metrics instead of from Sales Volume :

    *XDIM_MEMBERSET CATEGORY = REL

    *XDIM_MEMBERSET METRIC = VOL

    *XDIM_MEMBERSET PRODUCT_RM <> NO_RM

    *WHEN PRODUCT_RM

    *IS "<>NO_RM"

    *REC(EXPRESSION=([CATEGORY].[BUDV2014],[PRODUCT].[NO_RM],[METRIC].[SAL_VOL]) * %VALUE%, CATEGORY="BUDV2014")

    *ENDWHEN

    And yeah, depending on your volume of data for Volume/Qty, the performance might be an issue.

    Cheers.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 29, 2013 at 04:37 PM

    No replies yet😔

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 29, 2013 at 05:03 PM

    Hi Draksharam,

    Unfortunately your code is completely incorrect. You have to use LOOKUP to get quantity from APO model and loop records in COGS model. Can you clearly specify all dimensions you have in each model?

    B.R. Vadim

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.