MDX SCOPE Clarification

Hi All,
I Have applied scope for the Product category,Region,Reseller Measure ,as below:
SCOPE
[Geography].[Country].&[Australia],
[Product].[Category].[Category]
,[Measures].[Reseller Tax Amount]
GO
This = [Measures].[Internet Tax Amount];
GO
END SCOPE;
Select
[Measures].[Reseller Tax Amount],[Measures].[Internet Tax Amount]
} ON 0,
([Product].[Category].&[1],[Geography].[Country].&[Australia])
} ON 1
From
[Adventure Works]
The above query is passed the above scope , it is giving the result..
Again , tested by adding date measure 
Select
[Measures].[Reseller Tax Amount],[Measures].[Internet Tax Amount]
} ON 0,
([Product].[Category].&[1],[Geography].[Country].&[Australia],[Date].[Calendar Year].&[2005])
} ON 1
From
[Adventure Works]
It is also giving the result as earlier....
Logically , it is correct .
But as per the scope statement , it violates ....
so , it should show the original select statement result ...
Could you please clarify this ..
Thanks,
Mahesh
Mahesh Alam

Hi Mahesh,
Your Scope is defined for the combination of objects (SubCube) [Geography].[Country].&[Australia], [Product].[Category].[Category],
[Measures].[Reseller Tax Amount]
So whenever these three object take part in a query either along with other objects or not, the defined scope becomes active.
Therefore in you case the second query would also fetch [Internet Tax Amount]
in place of
[Reseller Tax Amount] for the year 2005.
Basically Scope becomes active whenever the combination of objects defined in Scope takes part in MDX query irrespective of other objects involved in the query. So whenever additional objects along with the objects defined in scope take part in query, the
additional object is queried on the subcube created by Scope.
Saurabh Kamath

Similar Messages

  • Query on MDX SCOPE

    Hi All,
    Greetings..!!
    Requesting your help on below :
    I am analyzing the script at one of the project , it is similar to below : 
    SCOPE
    [Geography].[City].[All Geographies],
    [Date].[Calendar].[Calendar Year]
    THIS = ([Measures].[Internet Sales Amount],
            [Product].[Product Categories].[Category]
    END SCOPE;
    Then, i am querying to check the result as below :
    Select 
       [Measures].[Internet Sales Amount]
    } on 0,
    ([Geography].[City].[All Geographies],
        [Date].[Calendar].[Calendar Year]
    } on 1
    From
    [Adventure Works]
    Giving the Error as : 
    CellOrdinal 0
    VALUE #Error The  function expects a string or numeric expression for the  argument. A tuple set expression was used.
    FORMATTED_VALUE #Error The  function expects a string or numeric expression for the  argument. A tuple set expression was used.
    Screenshot:
    tried with different measures...
    How to test the scope condition. Please help on this .
    Thanks and Regards,
    Mahesh
    Mahesh Alam

    hi Mahesh,
    You specified a level in the scope statement THIS:
    [Product].[Product Categories].[Category]     ??
    wich is not a  "cube coordinate"
    If you complete it, let's say only the bikes, it will work:
    SCOPE ( 
      [Geography].[City].[All Geographies], 
      [Date].[Calendar].[Calendar Year] ); 
      THIS = ([Measures].[Internet Sales Amount], 
      [Product].[Product Categories].[Category].&[1] ); 
    END SCOPE 
    Philip,

  • How to trace whether member of an attribute is selected or not in cube browser by using mdx

    Suppose I have an attribute "District" under "Country" dimension. When dragging this attribute in the cube browser I want to trace which member(s) is/are selected and unselected. I want this to reflect the country total.
    For example, Country Z has A,B and C districts.
    if all A,B and C are selected then country total = A+C
    if A and C are selected then Country Total = A+C
    if B and C are selected then country total = B+C
    if A and B are selected then Country total = A
    this 'total' logic may vary on country. Taking another example.
    Country Y has three districts - D, E and F
    if D and E then total = D+E
    if E and F then total = E+F
    if D+E+F then total = D+E
    if D+F then total = D
    That's why I want to trace which member under District attribute is being selected or unselected under a specific country by mdx (scope may be) while browsing.
    It would be really kind enough if you would help me. Thanks in advance.
    Note: There might be other ways to handle the country total. If you have any, please share.

    Suppose I have an attribute "District" under "Country" dimension. When dragging this attribute in the cube browser I want to trace which member(s) is/are selected and unselected. I want this to reflect the country total.
    For example, Country Z has A,B and C districts.
    if all A,B and C are selected then country total = A+C
    if A and C are selected then Country Total = A+C
    if B and C are selected then country total = B+C
    if A and B are selected then Country total = A
    this 'total' logic may vary on country. Taking another example.
    Country Y has three districts - D, E and F
    if D and E then total = D+E
    if E and F then total = E+F
    if D+E+F then total = D+E
    if D+F then total = D
    That's why I want to trace which member under District attribute is being selected or unselected under a specific country by mdx (scope may be) while browsing.
    It would be really kind enough if you would help me. Thanks in advance.
    Note: There might be other ways to handle the country total. If you have any, please share.

  • Constructing Calculated Measures in MDX for different measures using same columns in a fact table

    Hello,
    i have a fact table with 2 columns corresponding to dimensions Dim1, Dim2. In the same table i have 4 other columns Value_Type(int), INT_VALUE(int), FLOAT_VALUE(float), TEXT_VALUE(string). There are a number of measures which are identified by Value_Type and
    depending on their nature could be written in one of the 3 columns (INT_VALUE(int), FLOAT_VALUE(float), TEXT_VALUE(string)) Let's say Measure1 with Measure_Type=1 is age, 2 is account balance and 3 is Name for clarity. There could be other measure types that
    use these 3 same columns for data. So the sample fact table looks like this
    Dim1 Dim2 Measure_Type INT_VALUE FLOAT_VALUE TEXT_VALUE
    10 10 1 25
    10 10 2 2000,34
    10 10 3 John
    10 20 1 28
    10 20 2 3490,23
    10 20 3 Frank
    My task is to write an MDX query for each Dim1, Dim2 combination which returns all 3 measures in the same row. The idea is to construct a calculated member for each Measure that returns value from the right field. For example for Measure1 we take INT_VALUE
    with measure_type=1. The problem is i don't know how to construct MDX query for these calculated members. Can you please help me?
    So my final goal is to write an MDX query that returns all measures in one row for each set of Dim1, Dim2
    SELECT [Measure1], [Measure2], [Measure3] ON COLUMNS,
    NON EMPTY [Dim1].[Dim1].[Dim1].Members*[Dim2].[Dim2].[Dim2].Members ON ROWS
    FROM [Cube]
    Dim1 Dim2 Measure1 Measure2 Measure3
    10 10 25 2000,34 John
    10 20 28 3490,23 Frank

    Hi Kosmipt,
    I would combine the "INT_VALUE", "FLOAT_VALUE" and "TEXT_VALUE" columns into one with STRING data type for the fact table. And there should be one dimension to store the Measure_Type informations. Then in cube, you can write MDX scope for every one of
    "Measure_Type" dimension members. For example,
    scope(
                [Measures].[M]
        [DimMType].[MType].&[1]= CINT([Measures].[M]);                                                                                                                             
    end scope;
    Once the cube is built by the above way, you can write MDX like something like the following to achieve your purpose.
    WITH member [Measures].[Measure1] AS ([DimMType].[MType].&[1],[Measures].[M])
             member [Measures].[Measure2] AS ([DimMType].[MType].&[2],[Measures].[M])
             member [Measures].[Measure3] AS ([DimMType].[MType].&[3],[Measures].[M])
    thanks,
    Jerry

  • How do I reuse my Date dimension in every fact and dimension that has dates?

    Hi, all,
    I have a fact table in the middle of a star and three dimensions.  Each of the four objects has a modified date in it.  Is there a way for me to create and reuse a Date dimension for every one of the three dimensions and one fact?  I want
    to be able to slice data by ModifiedDate from D1, ModifiedDate from D2, ModifiedDate from D3, and ModifiedDate from F1 at the same time because I have a very custom date roll-up by which I want to see the data.
    I suppose I can re-instance the Date table in the DSV 4 times, but I wanted to know if I can resolve this via a separate Date dimension.  Thanks!

    Hi,
    If say you want to slice the cube on modified date from all dimension D1, D2 and D3 using a single attribute, then try if the following works
    create a new date attribute lets say [Slice Date] in Date dimension and later use MDX scope statement somewhat like this
    Scope([Date Dim].[Slice Date].CurrentMember);
    this = (strtomember('[D1 Dim].[Modified Date]'+right([Date Dim].[Slice Date].CurrentMember.uniquename,len([Date Dim].[Slice Date].CurrentMember.uniquename)-23)),
    strtomember('[D2 Dim].[Modified Date]'+right([Date Dim].[Slice Date].CurrentMember.uniquename,len([Date Dim].[Slice Date].CurrentMember.uniquename)-23)),
    strtomember('[D3 Dim].[Modified Date]'+right([Date Dim].[Slice Date].CurrentMember.uniquename,len([Date Dim].[Slice Date].CurrentMember.uniquename)-23))
    end scope;
    Saurabh Kamath

  • Clarification?: Frank & Lynn's book - task flow "shared" data control scope

    I'm seeking clarification around shared data control scopes please, regarding a point made in Frank Nimphius and Lynn Munsinger's "Oracle Fusion Developer Guide" McGraw-Hill book.
    On page 229 there is a note that states "The data control scope can be shared only if the transaction is also shared". Presumably this implies that only the transaction options "Always Use Existing Transaction" or "Use Existing Transaction if Possible" are applicable for a shared data control scope.
    However this seems at odds with what the IDE supports, as you can also select the transaction options "<No Controller Transaction>" and "Always Begin New Transaction" when the data control scope is set to shared.
    What's correct? The IDE or the book?
    Your assistance appreciated.
    CM.

    Chris,
    "The data control scope can be shared only if the transaction is also shared"
    At least the book stands correct for what I could test in a simple test case:
    1. no transaction - no sharing
    - no master/detail synchronization. DC are bot shared
    - commit in called btf does not commit caller task flow
    2. "always use existing" transaction selects shared Data Control and automatically disables this field so there is no other option for this
    3. Share DataControl and "Always begin transaction"
    Committing transaction in called btf also commits the transaction in calling TF
    So bottom line is that the transaction handling in ADFc appears to be confusing as it only is a directive for the DataControl to interpret.
    Also see page 14 "Task flow "new transaction" vs. "new db connection"" of : http://www.oracle.com/technetwork/developer-tools/adf/learnmore/march2011-otn-harvest-351896.pdf
    In ADF BC it seems that separated transactions only exist if you use isolated mode. If you use shared and new transaction then basically the transactions are not isolated.
    Frank
    Ps.: I took an action item to follow up with development about what the expected ADF BC behavior for the controller settings are.

  • Exclude members from a scope - MDX SSAS

    Hi all,
    I'm just beginning with MDX so the answer may be obvious...
    I'm trying to do a currency conversion with an MDX statement in my Cube SSAS 2012.
    Here is my script :
           SCOPE( LEAVES([Entity]) );
    SCOPE( LEAVES([Time]) );
    SCOPE( LEAVES([Currency]));
    SCOPE( [Account].[Account].[Total ACCOUNT].members)
    THIS = ([Measures].[Value],[Currency].[Currency].[Local])*([Measures].[Value],[Account].[Account].[Fx Rate]);
    END SCOPE;
    END SCOPE;
    END SCOPE;
    END SCOPE;
    The problem is I want to exclude frome the scope Currency my local Currency in order to make the conversion only if a currency (€,$, £) is selected.
    I tried the following syntax but it always return a "MDX script is not valid" :
    SCOPE( LEAVES([Currency], Except (LEAVES([Currency],[Currency].[Currency].[Local]);
    SCOPE( [Measures].[Value] , Except ([Currency].[Currency].members,[Currency].[Currency].[Local]);
    SCOPE( [Measures].[Value] , Except (LEAVES([Currency],[Currency].[Currency].[Local]);
    SCOPE( LEAVES([Currency] - [Currency].[Currency].[Local]);
    Could you please help me with this ? Thanks.

    Hi MNelane,
    Please try to use the following MDX command:
    Scope( Leaves([Date]) , Except([Currency].[Currency].Members, [Currency].[Currency].[Local));
    For more information about currency conversion in SQL Serve Analysis Services, please refer to the articles below:
    Currency Conversion in SSAS 2012:
    http://social.technet.microsoft.com/wiki/contents/articles/18672.currency-conversion-in-ssas-2012-multidimensional-tabular.aspx
    Currency Conversion in Analysis Services:
    http://consultingblogs.emc.com/christianwade/archive/2006/08/24/Currency-Conversion-in-Analysis-Services-2005.aspx
    Regards,
    Elvis Long
    TechNet Community Support

  • SCOPE Function in MDX

    HI All,
    I have a very basic doubt in SCOPE function.
    We have a new calculated measure called CustomCalculation.
    The expression that I have used for this measure is :
    SCOPE ([Measures].[CustomCalculation]);
    THIS = ([Gender].&[Male],[Measures].[TotalPopulation]);
    END SCOPE;
    Here, the calculation is giving me the correct value,  but below are my questions:
    1- When we simply drag the new calculated measure, it gives NULL
    2- When we drag any other dimension apart from Gender, it gives NULL
    3-It only shows value when we drag Gender dimension, in the presence of Gender dimension it will show the correct value for other dimensions also, but as soon as I remove Gender dimension it will show NULL for every other objects.
    Is this the intended behavior of SCOPE function or I am doing any wrong thing.
    Thanks
    Sudipta Ghosh
    Sudipta Ghosh Tata Consultancy Services

    Hi Sudipta ,
    Since your Scope will create always the (Male,TotalPopulation) tuple, it should show values for Male only .
    Let's say we dragged the Female member . We will expect to get no data back cause only the Male member is used in the calculation .
    Guessing the default member is something like [gender].[gender].[All] can be the explanation for your questions .. Change the 'DefaultMember' property of the gender attribute to [Gender].&[Male] to overcome the issue OR you can create an All genders
    scope for the All member calculation :
    Scope([Measures].[CustomCaculation], [gender].[gender].[All] );
    This= Aggregate([gender].[gender].[gender] , [Measures].[CustomCaculation]) ;
    End Scope ;
    Hope it helps :)
    Regards, David .

  • Scope of instance variables clarification requested

    under the topic "Scope of instance variables" in the class notes for the course i'm doing it is stated:
    inside the class definition, the name can be prefixed by the keyword "this".
    e.g. available = this.balance + overdraft;
    in simple words, please explain what it means
    or:
    what is a class definition? and what does using "this" mean?
    i'll gladly take internet links on where i can find the answer to my own question if you don't have time.
    thanks a million!

    this can be regarded simply as a reference variable which points to the intance of the class it's used in.
    So this.fieldOne referer to the instance field fieldOne withing the current instance just as theOther.fieldOne refers to the instance field in another object.

  • Controlling Scope in MDX

    Hi
    I have a problem controlling the posting to several dimensions. I have the following code:
    *SELECT (%MODEL%, ID, MODEL, [MATL_TYPE] = "PARTS")
    *FOR %MOD% = %MODEL%
           [MODEL].[#%MOD%] = ([P_ACCT].[P00200],[MODEL].[DUMMY]) * ([P_ACCT].[IKR0000500000],[MODEL].[%MOD%])
    *NEXT
    *COMMIT
    However, I want to control the posting to another account (IKR0000616560)  that it is posting to at the moment. I have tried the following:
          ([P_ACCT].[#IKR0000616560],[MODEL].[#%MOD%]) =  ([P_ACCT].[P00200],[MODEL].[DUMMY]) * ([P_ACCT].[IKR0000500000],[MODEL].[%MOD%])
    But I get an error: "Invalid MDX Statement"
    How can I get the posting to post to the account I want?
    Any help appreciated.
    L.

    Here is the full code, where should I place the commit?
    //Calculate COS
          [P_ACCT].[#IKR0000608050] =  ( 1 - [P_ACCT].[P00003] ) * [P_ACCT].[IKR0000500000]
          [P_ACCT].[#IKR0000608070] =  ( 1 - [P_ACCT].[P00003] ) * [P_ACCT].[IKR0000500010]
          [P_ACCT].[#IKR0000610510] =  ( 1 - [P_ACCT].[P00003] ) * [P_ACCT].[IKR0000500020]
          [P_ACCT].[#IKR0000608100] =  ( 1 - [P_ACCT].[P00003] ) * [P_ACCT].[IKR0000500040]
    *COMMIT
    *SELECT (%MODEL%, ID, MODEL, [MATL_TYPE] = "PARTS")
    *DIM_MEMBERSET P_ACCT = "IKR0000616560"
    *FOR %MOD% = %MODEL%
          [MODEL].[#%MOD%] = ([P_ACCT].[P00200],[MODEL].[DUMMY]) * ([P_ACCT].[IKR0000500000],[MODEL].[%MOD%])
    *NEXT
    *COMMIT
    What I want is a posting to IKR0000616560, whether there is a change to P00003, P00200 or any other account. At the moment the code posts to any of the changed accounts and no posting to IKR0000616560.

  • I need a clarification : Can I use EJBs instead of helper classes for better performance and less network traffic?

    My application was designed based on MVC Architecture. But I made some changes to HMV base on my requirements. Servlet invoke helper classes, helper class uses EJBs to communicate with the database. Jsps also uses EJBs to backtrack the results.
    I have two EJBs(Stateless), one Servlet, nearly 70 helperclasses, and nearly 800 jsps. Servlet acts as Controler and all database transactions done through EJBs only. Helper classes are having business logic. Based on the request relevant helper classed is invoked by the Servlet, and all database transactions are done through EJBs. Session scope is 'Page' only.
    Now I am planning to use EJBs(for business logic) instead on Helper Classes. But before going to do that I need some clarification regarding Network traffic and for better usage of Container resources.
    Please suggest me which method (is Helper classes or Using EJBs) is perferable
    1) to get better performance and.
    2) for less network traffic
    3) for better container resource utilization
    I thought if I use EJBs, then the network traffic will increase. Because every time it make a remote call to EJBs.
    Please give detailed explanation.
    thank you,
    sudheer

    <i>Please suggest me which method (is Helper classes or Using EJBs) is perferable :
    1) to get better performance</i>
    EJB's have quite a lot of overhead associated with them to support transactions and remoteability. A non-EJB helper class will almost always outperform an EJB. Often considerably. If you plan on making your 70 helper classes EJB's you should expect to see a dramatic decrease in maximum throughput.
    <i>2) for less network traffic</i>
    There should be no difference. Both architectures will probably make the exact same JDBC calls from the RDBMS's perspective. And since the EJB's and JSP's are co-located there won't be any other additional overhead there either. (You are co-locating your JSP's and EJB's, aren't you?)
    <i>3) for better container resource utilization</i>
    Again, the EJB version will consume a lot more container resources.

  • MDX for Start of Month Values at Daily level

    Hey Guys,
    I am dealing with a requirement as below, the solution i have is either not addressing the complete problem or is extremely slow and in many cases just not feasible. Need a little help on the same.
    Problem: Need a query with cross join of 4 dimension (10 levels) and a date dimension, i need to determine a measures's first
    available value across time periods such as Start of month, start of year Etc.. 
    I have 
    dimA - Level A1
    dimB - Leve B1,B2,B3
    dimC - Level C1
    dimD - LevelD1, D2,D3,D4,D5
    Date Dimension - Date, Month, Year as levels.
    Measure - M1 To M5
    Query: 
    SELECT
    NON EMPTY
    [Measures].[M1]
    ,[Measures].[M2]
    ,[Measures].[M3]
    ,[Measures].[M4]
    ,[Measures].[M5]
    ,[Measures].[M1SOM]
    } ON COLUMNS
    ,NON EMPTY
    [DimA].[A1].[A1].ALLMEMBERS*
    [DIMB].[B1].[B1].ALLMEMBERS*
    [DIMB].[B2].[B2].ALLMEMBERS*
    [DIMB].[B3].[B3].ALLMEMBERS*
    [DIMB].[B4].[B4].ALLMEMBERS*
    [DIMB].[B5].[B5].ALLMEMBERS*
    [DIMC].[C1].[C1].ALLMEMBERS*
    [DIMD].[D1].[D1].ALLMEMBERS*
    [DIMD].[D2].[D2].ALLMEMBERS*
    [DIMD].[D3].[D3].ALLMEMBERS*
    [Date].[Date].[Date].ALLMEMBERS*
    [Date].[Month].[Month].ALLMEMBERS*
    } ON ROWS
    FROM
    [Cube]
    ***The above query has all those cross joins as this query would power an SSRS report dataset.
    Need to create a new calculated measure or a real (persisted measure) that displays the Start of month & Start of year Values. Below are the options i have currently. Lets assume, Measure M1 is the one for which i need the SOM and SOY values.
    Create a persisted measure (M1SOM) based off the measure M1 and provide an aggregation function of "FirstNonEmpty" : This works perfectly when we run a query at Month level i.e. in the above query have [Date].[Month].[Month].Allmembers instead
    of [Date].[Date].[Date].Allmembers. It displays the first available non empty value of the month. However, this means the rest of the measures are aggregated at month level. If i want to display the daily values of the other measures along with SOM values
    for this measure it wont work, cause the scope now changes to a single date and i just get the daily value in the M1SOM measure as well.
    Create a calculated measure (M1SOM) as below, along with the query above and the same thing happens. Cant display the SOM values at a daily date level.
    WITH
    MEMBER [Measures].[M1SOM] AS
    [Date].[Date].FirstChild
    ,[Measures].[M1]
    3. Create a calculated member as below, This works! however, the query
    absolutely kills my machine and takes forever to execute, if i run it with more than 3 levels in the cross join. 
    WITH MEMBER M1SOM AS Head(NonEmpty({[Date].[Date].Parent.Children}*[Measures].[M1SOM])).Item(0)
    Is there a better way to achieve the SOM and SOY calculations at a daily level?
    Thanks
    Srikanth

    Hi Srikanth,
    Basically you want to get the cell values on different granularity for date dimension in the same result set. For performance consideration, we suggest to use MDX to get the 2 types of value separatedly and merge with T-SQL.
    Below is an example on how to get data from MDX within T-SQL for your reference.
    SET
    @mdx
    =
    '{some
    dynamic MDX}' 
    SET @sql
    =
    'SELECT a.* FROM
    OpenQuery(LinkedAnalysisServer, '''
    +
    @mdx
    +
    AS a' 
    BEGIN TRY 
    INSERT INTO #result 
    EXEC sp_executesql @sql 
    END TRY 
    BEGIN CATCH 
      IF ERROR_NUMBER <>
    'The error number you are seeing' 
      BEGIN 
        RAISERROR('Something happened that was not an empty result set') 
      END 
    END CATCH 
    SELECT * FROM
    #result 
    Regards

  • Script Logic: Using a property in MDX *REC statement (BPC NW)

    Hi,
    Is it possible to use a Property in an MDX statement without using  *LOOKUP() function? I have script successfully working but it takes 15 minutes to execute and would like to speed it up.
    I understand that [DIMENSION].[MEMBER].Property is not valid syntax, and do not believe NW has any other functions to resolve the issue, except *LOOKUP which takes a long time.
    Specific Example is below:
    I have a piece of script that successfully splits JV Expense by customers. A Profit Share planning driver determines the percentage that each customer is entitled to. Typically this will be 100%, but could be 50% between two customers.
    The PROFIT SHARE planning drivers records, and PARTNER_INCOME transactional records are below:
    ACCOUNT
    ENTITY
    PARTNER
    SIGNED DATA
    PROFIT_SHARE
    UK_001
    PARTNER_A
    0.5
    PROFIT_SHARE
    UK_001
    PARTNER_B
    0.5
    PROFIT_SHARE
    UK_002_PLANNING_DRIVERS
    PARTNER_B
    1.00
    PARTNER_INCOME
    UK_001
    NO_PARTNER
    $5,000
    PARTNER_INCOME
    UK_002
    NO_PARTNER
    $5,000
    UK_001 has two partners that are each entitled to 50% of the $5,000 NET PROFIT.
    For UK_002, one one single Partner is entitled to 100% of the $5,000 NET PROFIT.
    Using script logic, you can scope the Profit Share account (PROFIT_SHARE) - , and use a *REC statement to multiply this by the driver. It would look like:
    *XDIM_MEMBERSET ACCOUNT = PROFIT_SHARE
    *WHEN ACCOUNT
    IS *
    *REC (EXPRESSION = %VALUE% * ([ACCOUNT].[PROFIT_SHARE],[PARTNER].[NO_PARTNER]), ACCOUNT = PARTNER_PROFIT_SHARE)
    *ENDWHEN
    This wouldn't be a problem if the Planning Driver is always stored on the same Entity that the Income is stored on, but for UK_002, the planning driver is stored on another Entity - which is stored in a the PLAN_DRIVER_REF property of the entity. It should use UK_002_PLAN_DRIVERS
    ID (Entity)
    PLAN_DRIVER_REF
    UK_001
    UK_002
    UK_002_PLAN_DRIVERS
    UK_002_PLANNING_DRIVERS
    In this scenario, we need to switch out the Entity used in the MDX, however I do not believe you can use a property in MDX - can anyone confirm?
    I have currently implemented the *LOOKUP functionality to loop through, changing each *LOOKUP partner for each loop.
    Lookup:
    *LOOKUP PLANNING_JV_US
    *FOR %LOOP_ASLS% = %ASL_LOOKUP_LOOP_VARIABLE%        
      *DIM LOOK_%LOOP_PARTNERS%:ACCOUNT = "PROFIT_SHARE"
      *DIM LOOK_%LOOP_PARTNERS%:PARTNER= %LOOP_PARTNERS%
    *NEXT
    *DIM ENTITY = ENTITY.PLAN_DRIVER_REF                   //   Use PLAN_DRIVER_REF Property of Entity
    *ENDLOOKUP
    Scope and *REC:
    *XDIM_MEMBERSET ACCOUNT = PROFIT_SHARE
    *WHEN ACCOUNT
    IS *
    *FOR %LOOP_PARTNERS% = %PARTNER_LOOKUP_LOOP_VARIABLE%      // 1000 Partners
    *REC(EXPRESSION = %VALUE% * LOOKUP(LOOK_%LOOP_PARTNERS%), PARTNER= %LOOP_PARTNERS%, ACCOUNT = TCOJVSHAR_CALC, AUDIT_ID = PP_EXPENSE_BY_PARTNER)
    *NEXT
    *ENDWHEN
    The problem with the above, is that because the Lookup is being generated for every single Partner, there are significant numbers of loops.
    Does anyone know of another way this can be implemented in Script Logic? Otherwise we'll need to explore BAdI route.
    Thanks,
    Nick

    Hi Nick,
    Use property in LOOKUP - will dramatically speed up the calculation without FOR/NEXT.
    Vadim

  • Scope of Planning for Total Planning

    Hi SAP Gurus,
    My Client Scenario is as follows
    They import Spare Part materials from abroad to a Main Warehouse (defined as Plant in SAP) and then do stock transfer to around 60+ warehouse in different states (each defined as Plant in SAP).
    At any time Stock exists in any of 60+ Plant and Main ware house Plant. However Purchase requirement and Purchase Order is created and placed from Only Main Warehouse Plant.
    Now I am implementing Consumption based Planning with MRP.  I am Planning to define a Scope of Planning for Total Planning.
    Clarification I request :
    1. Whether I need to define Only all 60+ Plants in Scope of Planning or can I include Main warehouse Plant also ?
    2. In which case if there is requirement in one individual Plant and there exists stock in another one Plant - whether system will automatically create stock transfer Planned order. What Special procurement type I need to define for this (If it is 40 , whether I need to define any Issuing Plant, since I have 60 + Plants)
    3. If I have to run Forecast and Planning run daily for 60+ Plants and weekly for Main warehouse Plant, Whether I need to create a Separate Scope of Planning for 60+ Plants and a Separate Variant for Main ware house Plant with different Schedules - Am I correct
    Thanks and Regards,
    R.Velmurugan.

    Hi Kumar,
    Thanks for your immediate response.
    If we define Special procurement type 40 for 60+ warehouse Plants materials with Supplying plant as Main Warehouse Plant, then if there exists stock in one of 60+ Plants and there is requirement in one of another 60+ plants how system will consider and create stock transfer between them.
    Whether stock transfer between 60+ as well as Main plant is Possible ? If possible how to define Special Procurement type ?
    Secondly what ever issued from 60+ Plants is the real Consumption of Material (as Material issued from Main ware house plant to 60+ Plants is only stock transfers and not real consumption).
    In which case how to go about for forecast and MRP run for 60+ Plants and Main plant ?
    Thanks,
    R.Velmurugan

  • Controlling scope of availability check

    Hi,
    The requirement is to have different scope for availability check when Standard Sales Order and a Replacement Order (Replacing the goods for free).
    In the above scenario, the item category is different, so we can have different requirement type, hence can have different requirement class.
    Item category determination is based on Sales document type, but availability check do not have any control at sales document type level.
    Scope of availability check can be controlled with the combination of Checking group (material master) and checking rule.
    I need clarification here on how we can get different scope of check for the same material.
    Clarification on this is highly appreciated.
    Regards.

    Checking Rule is assigned with Plant also. So if Replacement Order is created from a single Plant then you can achieve the same.
    Else if you don't want to run Availabily Check then you can remove the checkbox "Availability" from Schedule Line Category.
    Best Regards,
    Ankur

Maybe you are looking for

  • You cannot change the price of an item AFTER I check out!

    I ordered an XMEN: Days of Future Past box set with a robot head last night for $17.99 plus tax for store pickup online. The total came out to be a bit over $20. When I checked my email today, I was charged $29.99 for the item, and tax based on the n

  • Standard reports required in FI

    HI Guru's, 1) BILLS RECEIVABLES & COLLECTION 2) CURRENCY FLUCTUATION 3) Financial cost (key raw material price trend) 4) List of Negative Items 5) Operating Expenses 6) DEBTORS AGEING 7) CREDITORS AGEING Please can any one tell me for above list is t

  • JVM Clustering

    if JVM Clustering is possible ! Then How ? Thanks&Regards vipin

  • Is there a way to convert larger files?

    This online program is restricted to 100M (and even IT keeps booting my from the on-line account before it manages to fully upload some of my smaller files I wanted to convert. I got kicked out before a 18M file uploaded for example.) Is there a way

  • How to properly uninstall?

    Hello there. I was used to win xp where there was a unistall button for almost every program you downloaded but seems like mac doesn't have that. I need to get rid of a couple programs from my computer and would like to know the best way to uninstall