Skip to Content
author's profile photo Former Member
Former Member

ADDITION USING SCRIPT LOGIC

Hi All,

Under 'INCOME' i have 3 accounts.

account1

account2

account3

i want to add the value of these 3 account then i want to multiply with 3

the result i want to display in "account4"

What is the required script logic for this?

Regards,

Phanikumar.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 09, 2010 at 04:15 AM

    Hi,

    You can use,

    [ACCOUNT].[#account4]=([ACCOUNT].[account1]+[ACCOUNT].[account2]+[ACCOUNT].[account3])*3
    

    here, ACCOUNT is the name of the dimension where the members account1,account 2 etc are present.

    Hope this helps,

    Regards,

    G.Vijaya Kumar

    Edited by: G.Vijaya Kumar on Jul 9, 2010 6:38 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 09, 2010 at 04:34 AM

    Phanikumar, below is a sample BPC SQL script for adding the 3 values and storing them in Account4.

    I hope this helps.

    Sean

    *WHEN ACCOUNT

    *IS "ACCOUNT1"

    *REC(EXPRESSION=(%VALUE% + GET(ACCOUNT="ACCOUNT2") + GET(ACCOUNT="ACCOUNT3"),ACCOUNT="ACCOUNT4")

    *ENDWHEN

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 09, 2010 at 05:58 AM

    Hi Phani Kumar,

    BPC 7.0 NW doesnt support GET, so you cannot have the script as

    *WHEN ACCOUNT
    *IS "ACCOUNT1"
       *REC(EXPRESSION=(%VALUE% + GET(ACCOUNT="ACCOUNT2") + GET(ACCOUNT="ACCOUNT3"),ACCOUNT="ACCOUNT4")
    *ENDWHEN

    Instead you can modify the script to

    *WHEN ACCOUNT
    *IS "ACCOUNT1","ACCOUNT2","ACCOUNT3"
       *REC(FACTOR = 3, ACCOUNT="ACCOUNT4")
    *ENDWHEN

    If you want to go with MDX, then you can use as suggested earlier

    [ACCOUNT].[#account4]=([ACCOUNT].[account1]+[ACCOUNT].[account2]+[ACCOUNT].[account3])*3

    Hope this helps.

    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.