Skip to Content
author's profile photo
Former Member

Calculating sum in script logic

Dear all.

I am having a script which should be moving values from one parent account to another base account in default logic, but only if posted on certain other dimension, that is when not posted on a certain Brand in my brand dimension.

Sounds pretty much simple.. 😊

*WHEN CATEGORY 
*IS ACTUAL
*WHEN BRAND
*IS <> B_2600
  *WHEN ACCOUNT 
  *IS  BAS(GROSS_PREORDER)
    *REC(EXPRESSION=([ACCOUNT].[GROSS_PREORDER]) ,ACCOUNT=GROSS_PREORDER_NOST)
  *ENDWHEN
*ENDWHEN
*ENDWHEN

So if any values are posted on a base member of "GROSS PREORDER"-account, then put it onto GROSS_PREODRE_NOST, but only if CATEGORY = ACTUAL and BRAND different from B_2600.

The above script works fine, as long as I only post one record at a time, but that's not realistic. The users necessarily need to be able to input data on all base members of GROSS_PREORDER and then send data.

When you post eg. on three separate accounts below GROSS_PREORDER the result is posted three times onto GROSS_PREORDER_NOST.

I cannot seem to find a good solution for this, but I don't think I'm the first facing this issue..?

Best regards

Mogens

PS. I am using BPC NW 7.5 SP05

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    author's profile photo
    Former Member
    Posted on May 04, 2011 at 11:46 AM

    Hi,

    The script you have used will post each of the members under GROSS_PREORDER to GROSS_PREORDER_NOST.

    So, for example if you have 3 accounts below GROSS_PREORDER and you send the values as 100, 200, and 300 to those 3 accounts, then if you report on GROSS_PREORDER_NOST, you will see 600.

    Are you not getting something like above?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Nilanjan.

      That works. 😊

      I don't really see why it should work compared to my first script, but isn't that just the irony of script logic..?

      In order to not put every and all data into my sum account I modified

      *WHEN ACCOUNT 
        *IS *
      

      to

      *WHEN ACCOUNT 
        *IS BAS(GROSS_PREORDER)
      

      Thank you very much for your help..

      Br.

      Mogens