Scope statement on a Hierarchy

Hi,
I have a week by quarter hierarchy (Quarter is parent and week is child) like the following:
  example:     Hierarchy   Measure
                     Q412          blank
                     oct 6          100
                     oct 13         200
I  want to update the parent cell value from blank to some value using the scope statement and do not want to update the child values but when i write scope statement the update happens to all the three cells above. What should i be doing to update
only the parent?
Following is the scope statement i wrote which is updating all 3 cells to same value of 20
       SCOPE(MEASUREGROUPMEASURES("ABC"),[DATE].[WEEK BY QTR].[QTR].&[Q412]   );
             this=20;
      END SCOPE;

Hi David,
Before running the scope statement you given above the result looks like the following
Q412
Oct 06 12
100
Oct 13 12
200
Oct 20 12
300
After running the scope statement it updates the parent and child with the value of 20. I want the parent to get the latest value which is 300.
Q412           20
Oct 06 12
20
Oct 13 12
20
Oct 20 12
20

Similar Messages

  • Sql statement for Organization Hierarchy

    Good day,
    Just wondering if there's a script/sql statement that would generate the Organization Hierarchy (similar to Organization Hierarchy Editor) in Oracle HRMS EBS 11.5.10
    Thanks
    Elmer

    Just wondering if there's a script/sql statement that would generate the Organization Hierarchy (similar to Organization Hierarchy Editor) in Oracle HRMS EBS 11.5.10Please see if (How To Extract HR Organization Hierarchies by SQL? [ID 463359.1]) helps.
    Thanks,
    Hussein

  • Financial Statement Item - 0GLACCEXT hierarchy in Query

    Hi,
    I have loaded the Financial Statement Item hierarchy(0GLACCEXT_T011_HIER ) in to BI from R/3. I have made it as an infoprovider & included it in the multiprovider along with the GL Line items cube (other I/Os are also there). Next what all do I need to do for that to appear in the reports? That hierarchy selection in the query I have done but unable to expand the hierarchy!
    Thanks,
    Shreesh.

    Hello Padel,
    Be sure you take care of I_PACKAGESIZE parameter.
    If volume of data is less than I_PACKAGESIZE, it's OK. If volume of data is greater than I_PACKAGESIZE, You won't see any data. In this case, your function module has to produce data packets of size I_PACKAGESIZE.
    Hope it helps.

  • Scope statement for Change From Prior Year

    Hello All,
    I have to create Current Year, Prior year  and change from Prior year for all the measures. I was able to creat current Year and Prior Year calcuation with scope statemnet. But I could not do the same for Change from Prior year.  I am getting 0 for
    all the months.
    Here is what i have:
    SCOPE([LABEL].[LABEL].&[ChangeFromPY])
    THIS=
    AGGREGATE(
    [DATE DT].[Date_Hierarchy].CURRENTMEMBER,
    [LABEL].[LABEL].&[Current Year]
    AGGREGATE(
    PARALLELPERIOD
    [DATE DT].[Date_Hierarchy].[Year], 1, [DATE DT].[Date_Hierarchy].CURRENTMEMBER),
    [LABEL].[LABEL].&[Prior Year]

    Hi Om25,
    According to your description, the Prior year calculation works on Excel, however, it not works when creating dashborad in performance Point, right? In this case, you can create separate measures for Prior Year in Cube, and use it in performance Point directly.
    Here is a link that might helpful for you, please see:
    http://www.bidn.com/blogs/cprice1979/ssas/2473/fun-with-mdx-ndash-part-3-ytd-and-prior-ytd-calculations
    Regards,
    Charlie Liao
    TechNet Community Support

  • Representing a calculation schema within a dimension hierarchy

    Hi,
    I want to build a reporting hierarchy in SSAS to have it readily available for reporting.
    The real hierarchy look like:
    http://i59.tinypic.com/2irl0k1.png
    However I want it to be like the following:
    http://i57.tinypic.com/2v93rl2.png
    I have tried to do this with the following statement in the cube design:
    Scope([DIM Contribution Margin].[Hierarchy].[CM1 KEY].&[DB1]);
    This = [DIM Contribution Margin].[Hierarchy].[CM1 KEY].&[DB1]
    + [DIM Contribution Margin].[Hierarchy].[CM1 KEY].&[TURNOVER];
    End Scope;
    Scope([DIM Contribution Margin].[Hierarchy].[CM1 KEY].&[DB2]);
    This = [DIM Contribution Margin].[Hierarchy].[CM1 KEY].&[DB2]
    + [DIM Contribution Margin].[Hierarchy].[CM1 KEY].&[DB1];
    End Scope;
    However, this has an effect on the other dimensions. When I now put just the products on one axis the result is messed up.
    How can this be done?
    Many thanks in adavance.
    Calculated Member are not a solution, because to my knowledge they cannot be placed freely in the hierarchy.

    Hi Felix,
    It looks like the simple hierarchy  you are querying  should have been conceived as a ragged hierarchy instead.  This is remarkable because the labels have also a financial nature. 
    Instead of struggling with scope statements, is it an option to build that hierachy like those find in a financial cube?:
    http://martinmason.wordpress.com/2012/02/26/the-ssas-financial-cubepart-1ragged-hierarchies/
    Philip,

  • "Totals calculation issue" when I filter member used in an scope calculation with descendant aggregation

    Hello everybody
    I have a Geography dimension (Country -> State -> City) and 2 related Fact Tables: "Revenues" (with measure Revenue) and "Revenue Goal" (with measure Revenue Goal)  and  created a dummy measure into the Revenue Fact table
    (in the dsv) to calculate the Revenue not planed (by city) using Scope.
    The calculated measure "NotPlannedRevenue" is defined using a Dummy measure on the Revenue FacTable with null like default value, later using Scope I have calculated the values in order to get correctly Totals Values over the a Geography hierarchy
    which is working properly. The MDX script for the measure is 
    SCOPE([Measures].[NotPlannedRevenue]);
    SCOPE ([Geography].[GeoHier].[City].Members);
    THIS=iif([Measures].[Revenue Goal]=0 , [Measures].[Revenue] ,0 );
    END SCOPE;
    SCOPE( [Geography].City.[All]);
    This =sum( Descendants([Geography].[GeoHier].CurrentMember,,LEAVES),[Measures].[NotPlannedRevenue]);
    END SCOPE;
    SCOPE( [Geography].State.[All]);
    This =sum( Descendants([Geography].[GeoHier].CurrentMember,,LEAVES),[Measures].[NotPlannedRevenue]);
    END SCOPE;
    END SCOPE;
    When I check the data,  I get "Totals" well calculated.
    The issue is when I filter Cities from the Geography dimension, the total values are not being calculated using only the selected cities. I have problems in the totals by City, State, Country.
    The total for the State "Karnatak" must by "0" and the grand total must be "10".
    Please someone could help me to solve the way which I must write this MDX or maybe I have to use another strategy.
    Thanks in advanced.
    Gelder de la Ossa

    You shouldn't need the second and third SCOPE statements (on the All members of City and Country) if the first one has been configured correctly - what happens if you remove them?
    Chris
    Check out my MS BI blog I also do
    SSAS, PowerPivot, MDX and DAX consultancy
    and run public SQL Server and BI training courses in the UK

  • [Time].[Date].[Date] vs. [Time].[Date].Members in a Scope

    Hi folks,
    I'm just trying to understand how the subcubes are created using SCOPE.
    Example 1:
    SCOPE([Measures].[Credit Note CA]);
    SCOPE([Date NextYear].[Date].[Date], [Time].[Date].Members, [Currencies].[Currency].[Currency]);
    THIS = [Measures].[Credit Note LC] * [Measures].[Exchange Rate To Euro NY];
    END SCOPE;
    END SCOPE;
    Example 2:
    SCOPE([Measures].[Credit Note CA]);
    SCOPE([Date NextYear].[Date].Members, [Time].[Date].Members, [Currencies].[Currency].[Currency]);
    THIS = [Measures].[Credit Note LC] * [Measures].[Exchange Rate To Euro NY];
    END SCOPE;
    END SCOPE;
    The difference between both examples is: [Date NextYear].[Date].[Date] vs. [Date NextYear].[Date].Members
    If I use the 2nd one I get the results that I expected.
    I should explain that the measure [Measures].[Credit Note LC] is related to the 3 dimensions: [Date NextYear], [Time] and [Currency], while the measure [Measures].[Exchange Rate To Euro NY] is only related to [Time] and [Currency].
    The only different I can see if when I use the "Members" I get the set of members in the [Date] level, if not I get the same result + the All member, but I don't know exactly how this affect the subcube and my results.
    Could anyone explain me that? I would really appreciate it.
    Kind Regards,
    Paul

    Hi Paul ,
    Using [Date NextYear].[Date].[Date] will return the Date members without the All member .
    Using [Date NextYear].[Date].Members will return all members including the ALL member itself (assuming IsAggregatbla property set to true) .
    Please refer the next short but well written post from chris webb about that topic :
    http://cwebbbi.wordpress.com/2010/08/03/order-of-nested-scope-statements/
    Regards, David .

  • SCOPE Definition debuging

    Hi All,
    I am working at Prod Support Project on SSAS.
    At cube side many scope statements related to calculated members and measures are present at calculations tab.
    Could you please help us , how to check which part of the scope is applied to particular measure/calculated measure.......
    We are taking more time to find out the exact scope statement...
    Your's help is much needed here.
    Thanks & Regards,
    Mahesh Alam

    Hi Mahesh,
    According to your description, you want to know which part of the scope is applied to particular measure/calculated measure, right?
    Here is a sample SCOPE function in AdventureWork cube.
    Scope
    [Measures].[Amount],
    [Account].[Accounts].[Account Level 02].&[96], -- Headcount
    [Account].[Accounts].[Account Level 02].&[97], -- Units
    [Account].[Accounts].[Account Level 02].&[99] -- Square Footage
    Format_String ( This ) = "#,#" ;
    End Scope ;
    As you can see on function, there is a measures inside the scope function, so the scope is apply to this measures. We can use scope function inside scope function, if there is no measures specified inside the scope function, then the scope apply to the measures
    which were specified in the parent scope function.
    Reference.
    http://msdn.microsoft.com/en-us/library/ms145515.aspx
    Hope this helps.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Selection of Hierarchy for FS

    Hello there,
       I am attempting to run Business Content Query: 0FIGL_VC1_Q0002 which is based on Virtual InfoCube: 0FIGL_VC1
      I could successfully run Query: 0FIGL_VC1_Q0001(a separate query on this cube) and did receive the desired results.
      However, when I run the Query: 0FIGL_VC1_Q0002 it does NOT give me any application(transaction)data
      Hence, this query(0FIGL_VC1_Q0002) is actually based on the SAP supplied financial statement version Financial Statement (technical name INT)
      However, I`d like to use my Financial Statement Item <b>Hierarchy </b>which is loaded to InfoSource : 0GLACCEXT
      More specifically, let's look into SAP Standard Query Design of 0FIGL_VC1_Q0002
      It consists of list of Key Figures in the ROW.
    <i>Right-Click</i> on <b>Result</b>
       Edit Selection
       Under Financial Item Hierarchy, there is Hierarchy INT,
    how can I change it to mine ?
       At the moment, I don`t seem to see any other hierarchy selection?
    Message was edited with apologies by: John Mcluskey

    John,
    If in the BEx Query Designer in the FS item properties you clicked on a icon to the right from the hierarchy name field and couldn't see the other hierarchies, it means that you didn't upload hierarchy for 0GLACCEXT!
    You wrote that loaded hierarchy to infosource!? The hierarchy should be loaded to 0GLACCEXT infoobject. Besides, you need to load texts for this IO.
    Please describe what you've done in this regard so far. The more details the better.
    Best regards,
    Eugene

  • Performance problems with use SCOPE instruction?

    Hi All!
    We have application work with cube bases on SSAS 2008 R2. Also we use writeback function for change data in cube.
    Now I'm looking bottleneck in our queries.
    We have following MDX query(for example):
    select
    non empty{
    ([Date].[Date].[All].children
    , [Forecast Type].[Forecast Type].[All].children
    , [Stock].[Stock].[All].children
    , [Shipment].[Shipment].[All].children
    , [Invoice].[Invoice].[All].children
    , [Way Bill External].[Way Bill External].[All].children
    , [SD User].[User].[All].children
    , [SD Date].[Date].[All].children
    , [CD User].[User].[All].children
    , [CD Date].[Date].[All].children
    , [Forecast Basis].[Forecast Basis].[All].children
    , [Orders].[Orders].[All].children
    , [Rolling Forecast].[Rolling Forecast].[All].children
    , [Long Range Forecast].[Long Range].[All].children
    , [Calculated FCCR].[Calc Price].[All].children
    , [Write Table Guids].[GuidObj].[All].children)
    } dimension properties member_unique_name
    , member_type
    , member_value on rows
    , non empty {({[Measures].[Price CR]
    , [Measures].[Cost]
    , [Measures].[Cost USD]
    , [Measures].[Cost LME]
    , [Measures].[Cost MWP]
    , [Measures].[Weight]
    , [Measures].[Weight Real]})} dimension properties member_unique_name
    , member_type
    , member_value on columns
    from [MainCubeFCT]
    where ({[Currency].[Currency].&[4]}
    , {[Forecast Basis].[Customer].&[4496]}
    , {[Forecast Basis].[Consignee].&[4496]}
    , {[Forecast Condition].[Forecast Condition].&[1]}
    , {[Forecast Basis].[Alloy].&[56]}
    , {[Date].[Year Month].[Month].&[2015-05-01T00:00:00]}
    , {[Date Type].[Date Type].&[2]}
    , {[Forecast Basis].[Business Sphere2].&[4]}
    , {[Forecast Status].[Forecast Status].&[2]})
    Duration execution this query(Query end):
    cold(after clear cache) - 1000
    warm - 500
    Max loss on Calculate Non empty event - 95%.
    After some operations I found bottleneck in 2 measures: [Measures].[Weight], [Measures].[Price CR]
    If them deleted from query then duration execution equals 50.
    In our cube measure [Measures].[Weight] override in calculation as: 
    scope([Measures].[Weight]);
    This = iif((round([Measures].[Weight], 3)<>0), round([Measures].[Weight], 3), null);
    end scope;
    But if I change code as 
    scope([Measures].[Weight]);
    This = [Measures].[Weight];
    end scope;
    Performance query does not improve...
    If delete this override from calculation in cube. I get good performance acceptable to me.
    We need to keep the business logic and get acceptable performance.
    What wrong in measures, calculations or query? Any ideas?
    If need additional information let me know.
    Many thanks, Dmitry.

    Hi Makarov,
    According to your description, you get performance issue when using SCOPE() statement. Right?
    In Analysis Services, when using SCOPE() statement, it redefines that part of your cube space while the calculated member is much more isolated. In this scenario, I suggest you directly create a measure. Because calculated measure only returns values
    where the amounts are recorded directly to the parent without including children values.
    Reference:
    Analysis Services Query Performance Top 10 Best Practices
    Top 3 Simplest Ways To Improve Your MDX Query
    Best Regards,
    Simon Hou
    TechNet Community Support

  • Problem in Hierarchy in BEX Query

    Hi ALL,
    I have created Query for balance statements & Profit ,Loss statement by using hierarchy. It  is execuiting in perfectly.But the problem is "I want in the query output hierarchy with only 1 node that is Profit/loss node."
    I have done restriction on that node only. But I am not getting the output for that node.
    If I add one more node for Profit/loss node it is showing data.
    my question is If I restrict only one node why it is not working?
    please give me suggestions on this. <b>we need only one node in the output Hierarchy.</b>
    Plaese give me the steps Regarding this.
    Thanks,
    kiran.

    Hi srikanth,
    thanks for ur reply,
    My hierarchy having like this:
    Fiancial satement
              |--->Source of funds
              |---->App.of Funds
              <b><b>|---><b>Profit/loss node</b>->caliculated Profit</b></b>
              |------>Income
              |------->expendature
              |------->Un assained Node.
    1. I have not used any Structure .
    2. I have placed my Hiearachy in ROWS and I ahve restricted only Profit/Loss Node.
    ( But If I select only 1 node in Restriction data is not getting in query)
    IF I select "profit/loss node " & some other node in Restriction data is coming in the output of Query.
    What is the reason for this.
    whatt I have to do to get only 1 node in the output with values.
    Thanks,
    kiran
    Message was edited by:
            kiran manyam
    Message was edited by:
            kiran manyam

  • 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,

  • Unexpected Token '(' in expression or statement.

    I'm trying to retrieve DHCP server names and Leases using this script. But when I execute this section of the script of receive the following error message:
    Pwershell> C:\PowerShell\DHCPLease.ps1
    At C:\PowerShell\DHCPLease.ps1:287 char:25
    +  $line = $AllScopes[$i] (Read-Host " ").Split(",")
    +                         ~
    Unexpected token '(' in expression or statement.
        + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : UnexpectedToken
    Here is the part of the script that is failing
    #region Get all Scopes in the Server
    # Run the Command in the Show Scopes var
    $AllScopes=Invoke-Expression$ShowScopes
    # Go over all the Results, start from index 5 and finish in last index -3
    for($i=5;$i-lt$AllScopes.Length-3;$i++)
    # Split the line and get the strings
    $line=$AllScopes[$i](Read-Host"
    ").Split(",")  
    -   This is the line I receive the error
    $Scope.Address
    +=Check-Empty$line[0]
    $Scope.Mask
    +=Check-Empty$line[1]
    $Scope.State
    +=Check-Empty$line[2]
    # Line 3 and 4 represent the Name and Comment of the Scope
    # If the name is empty, try taking the comment
    If(Check-Empty$line[3]-eq"-")
    $Scope.Name
    +=Check-Empty$line[4]
    else{
    $Scope.Name
    +=Check-Empty$line[3]}

    That "read-host" seems weird, that cmdlet is supposed to be used to read input from a user typing into the console. Try changing this line
    $line = $AllScopes[$i] (Read-Host" ").Split(",")
    to this
    $line = $AllScopes[$i].Split(",")
    DJ Grijalva | MCITP: EMA 2007/2010 SPA 2010 | www.persistentcerebro.com

  • I have to load hierarchy from flat file

    Hi Guys,
                 I build a balance sheet Report,which is showing the report based on financial statement item(0glaccext)hierarchy.
    But previously client is maintaining some third party system,so client wants to load all the GL accounts in to BW.
    When i load the GL accounts in to BW using flat file,in report it is not showing based on hierarchy for the flat file GL accounts.
    So i need to load the hierarchy also for those GL accounts,how to load the GL accounts using flat file to maintain the hierarchy based on Assets,liabilities etc...

    Abdul,
    You might want to take a look here:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0403a990-0201-0010-38b3-e1fc442848cb
    or else see this weblog:
    /people/prakash.bagali/blog/2006/02/07/hierarchy-upload-from-flat-files
    assign points if useful
    kalyan

  • 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

Maybe you are looking for