Named Sets or calclated member

Hi friends
Need help regarding the MDX .I do have one Mapping table M1 with measure values.
A0   A1   A2   M1     M2
1    2      3    100    960
2    3      4    140    680
1    4      7    520    660
2    5      9    550    630
and one dimension table d1 having 20 records.
with columns as
id value         mapping column
1   Red            A0
2   orange        A0
3   green        A0
4   blue        A0
So when the Dimension table is joined with Fact/Mapping table i want my Output in cube as as :
OutPut:
In rows as Red  (A0)   and column M1(Measure) as 620. (Sum of 520+100)
Logic will work as follows in Fact Map Table.
If i go for filters(in Microsoft excel) in Mapping Table. While Selecting the A0 and filter Value as 1
The below data is displayed :
Red        A0   A1   A2   M1     M2
        1    2      3    100    960
        1    4      7    520    660
A0 (1 value or Other) is basically an ID .which is logically Build with RED (Dimension ID).Same as A0(2 Value) is with Orange.
Same way if any other filter is selected. it should work with same way(Filtering the data in Mapping table and then Sum of measures)
Please help . I neeed to build this logic for Fact tables.
Should i go for NAMED Sets or calculated member for the Fact logic(Filter)
        

Hi Rakesh ,
As I understand, you can't create a dynamic relationship between the fact table and the dimension table .
What we can do is to use calculated members/scopes to define how each measure will be calculated, or you can create 1 generic dimension that will be the base for 3 role-playing  (like generic Date dim and creationDate dim, deleteDatedim ..) and a mapping
column dimension, which will be used to select mapping column value, so you can use LinkMember functionality to 'jump' between the dims . 
Relations between each role-playing dimension will be regular .
Regards, David .

Similar Messages

  • Using named set in calculated measure is not working

    Hi Techies,
    I need an urgent solution. Here is my problem,
    I have a product dimension which has some "n" no of products. I need to create a measure with few members from the product dimension. (e.g. Sales for laptop & mobile explicitly, out of other electronic gadgets)
    I have created a static named set for some n number of products and a calculated measure in which I have included this named set as below,
    CREATE SET CURRENTCUBE.[Compact]
     AS {[Dim Prod].[Gadget].&[Laptop],[Dim Prod].[Gadget].&[Mobile]} ;        
    CREATE MEMBER CURRENTCUBE.[Measures].[Compact Sales]
     AS ([Compact],[Measures].[Sales]), 
    VISIBLE = 1   ; 
    but when I browse the cube the above measure is returning Null value. When I change the named set to dynamic, the measure is showing value but no filters(laptop & mobile) seems to be applied for that measure unless I add that named set explicitly in
    the filter area.
    I need a solution where I don't want to use any filters but the measure should work as expected.
    Please help me with this, it is very urgent.
    Thanks in advance,
    Latheesh
    latheesh

    hi Latheesh ,
    I'm not sure why do you need to create a new measure .. There is a problem to aggregate a set in a calculated member . I will suggest a new member on your
    Gadget dimension :
    CREATE SET CURRENTCUBE.[Others_Set]
     AS {[Product].[Product Categories].[Category].&[4],[Product].[Product Categories].[Category].&[1]} ;        
    CREATE MEMBER CURRENTCUBE.[Product].[Category].[Others]
     AS Aggregate([Others_Set]), 
    VISIBLE = 1   ; 
    select [Product].[Category].AllMembers on 1
    , [Measures].[Internet Sales Amount] on 0
    From [Adventure Works]
    Regards, David .

  • Sort data from a Named Set - SSAS

    Hi All,
    I am trying to create a Named Set called as "Last 13 Weeks", mdx code looks like below:
    EXCEPT({EXCEPT({Tail([Time].[Week].members,14)}, 
    {[Time].[Week].[All]})},{Tail([Time].[Week].members,1)})
    I have a Dim_Date dimension which consists of data from 2013 till 2015 year.Columns like Date,week,month,year. The above Named set is created as week filter, which will show last 13 weeks excludes from current week. Looks like below.
    Row Labels
    Count
    2015-01-18
    1392
    2015-01-25
    1400
    2015-02-01
    1433
    2015-02-08
    1449
    2015-02-15
    1457
    2015-02-22
    1456
    2015-03-01
    1456
    2015-03-08
    1456
    2015-03-15
    1471
    2015-03-22
    1477
    2015-03-29
    1484
    2015-04-05
    1497
    2015-04-12
    1504
    Now, weeks are displaying in ascending order. I would like to sort them in descending order, means last week should be displayed at top level and rest are followed in descending order.
    Please help me how I can achieve this solution in Named Set ?
    Any replies will be appreciate. Thanks.
    Maruthi... http://www.msbimaru.blogspot.com/

    Hi Maruthi,
    According to your description, you want to get the data of last 13 week and sort them in descending order. Right?
    In MDX, for sorting the records, we can use Order() function to achieve it, in this scenario, we can order the members based on the member name. Please refer to query below:
    select [Measures].[Internet Sales Amount] on 0,
    ORDER(TAIL([Date].[Calendar Weeks].[Calendar Week].members,13),
    [Date].[Calendar Weeks].currentmember.member_name,desc) on 1
    from
    [Adventure Works]
    Also you can use the ORDER() function for your set expression:
    Order(
    EXCEPT({EXCEPT({Tail([Time].[Week].members,14)},
    {[Time].[Week].[All]})},{Tail([Time].[Week].members,1)}),
    [Time].currentmember.member_name,
    desc
    Reference:
    Order (MDX)
    Best Regards,
    Simon Hou
    TechNet Community Support

  • Alternative to a Named Sets in Microsoft Cube for Analysis Edition for OLAP

    SAP has told me via there support system that they do not support Named Sets in Microsoft Analysis cubes and I need to be able to create specific time parameters to ease reporting requirements.  We are migrating off ProClarity and onto Analysis Edition for OLAP and need to be able to create these specific time dimensions.  I don't want to use custom groups as this would be hardcoding the values for the dates.  Is there any alternative to have these dates available in the Analysis application?  Any help would be greatly appreciated. 
    Please note that the Business Layer on the Webi side supports named sets and I have already implemented this for scheduled reports. Below is the MDX Name Set query for the Previous month based on our time dimension.
    ---- [Previous Month] ----
    Intersect ([Time].[Time Fiscal Year].[Month].Members, LastPeriods (1, Tail(Filter([Time].[Time Fiscal Year].[Month].Members, NOT IsEmpty(([Time].[Time Fiscal Year].CurrentMember, [Measures].DefaultMember))), 1).item(0).Lag(1)))
    Our Current Version:
    SAP Business Objects BI Platform 4.1 Support Pack 2 Patch 2

    When connecting to SSAS in a cluster, you do not specify an instance name.  In your case, you would use the name of the SSAS IP address to connect.
    See:
    http://msdn.microsoft.com/en-us/library/dn141153.aspx
    For servers deployed in a failover cluster, connect using the network name of the SSAS cluster. This name is specified during SQL Server setup, as
    SQL Server Network Name. Note that if you installed SSAS as a named instance onto a Windows Server Failover Cluster (WSFC), you never add the instance name on the connection. This practice is unique to SSAS; in contrast, a named
    instance of a clustered relational database engine does include the instance name. For example, if you installed both SSAS and the database engine as named instance (Contoso-Accounting) with a SQL Server Network Name of SQL-CLU, you would connect to SSAS using
    "SQL-CLU" and to the database engine as "SQL-CLU\Contoso-Accounting". See
    How to Cluster SQL Server Analysis Services for more information and examples.

  • Named set in cube doesn't appear in Universe

    I have several named sets in my cube that do not show up in the universe.  How can I get them to show up in the universe?  They contain a value for Yesterday which I need to use as a filter.  Is there a better way to create a filter for "yesterday"?

    Thank you for the info. 
    Can you help with the problem of creating a "yesterday" (or other date) filter?  I saw the thread "MDX syntax for current year in a Pre-defined condition"  in which you suggest using
    <EXPRESSION>
    IIF([Time Accounting].[Accounting Year.].CurrentMember.Properties("Name") = [Time Accounting].[Accounting Year.].CurrentMember.Properties("Current Year"), 1, 0)
    </EXPRESSION>
    to get the current year.  Could you elaborate on how to do that?  Do you put the expression in the filter like this?
    <FILTER KEY="[Date].[Date]">
        <CONDITION OPERATORCONDITION="Equal">
           <CONSTANT CAPTION=<EXPRESSION>
            IIF([Date].[Date].CurrentMember.Properties("Name") = [Date].[Fiscal Hierarchy].CurrentMember.Properties("Yesterday"), 1, 0)
          </EXPRESSION>/>
        </CONDITION>
    </FILTER>
    Please give me more details on l how to do this.  I'm new to the Business Objects OLAP Universe and more of a report developer than a programmer.

  • Named Set doesn't show aggregated values in excel while browsing

    Hi All,
    I have create a named to show Top 20 Clients Alphabetical. When I browse the named set, it is not showing aggregated values in the below.You can see in the image.
    Named Set Expression: 
    FILTER(
         Order
    ([Client].[Client].members,[Measures].[ACCOUNT RANK],BASC),
                  [Measures].[ACCOUNT RANK] > 0
                  AND [Measures].[ACCOUNT RANK] < 21)
    After reading blogs, I found I have to add ALLMEMBERS function inorder to show aggregated values in excel while browsing.
    http://prologika.com/CS/blogs/blog/archive/2009/01/27/named-set-subtotals-in-excel.aspx
    I implemented and some of them working fine but this is not working. Not sure what's happening.
    Modified Named Set Expression:
    FILTER(
         Order
    ([Client].[Client].allmembers,[Measures].[ACCOUNT RANK],BASC),
                  [Measures].[ACCOUNT RANK] > 0
                  AND [Measures].[ACCOUNT RANK] < 21)
    Please let me know, what else I can do to fix this issue. Thanks in advance and appreciate for reply.
    Maruthi...

    Hi Maruthi you just need a simple change in the Query .
    You need to include the All level and try using TopCount() function instead of the sequential FILTER/ORDER
    Try this,
    {TopCount
    [client].[client].allMembers
     ,20
    ,[Measures].[AccountRank]
    ),[client].ALL};
    Venkata Koppula

  • How to create server named sets in Essbase 9.3.1

    Hi there,
    I'm writing software against Essbase 9.3.1 Analytic Services right now and am trying to find out whether or not Essbase supports server named sets (not the session/query-scoped named sets that are created from CREATE SET or WITH respectively). I am able to execute the MDSCHEMA_SETS request against my Essbase server with the following response:
    <?xml version="1.0"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><m:DiscoverResponse xmlns:m="urn:schemas-microsoft-com:xml-analysis"><m:return xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><root xmlns="urn:schemas-microsoft-com:xml-analysis:rowset" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:schema xmlns="urn:schemas-microsoft-com:xml-analysis:rowset" targetNamespace="urn:schemas-microsoft-com:xml-analysis:rowset" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sql="urn:schemas-microsoft-com:xml-sql" elementFormDefault="qualified"><xsd:element name="root"><xsd:complexType><xsd:sequence minOccurs="0" maxOccurs="unbounded"><xsd:element name="row" type="row"/></xsd:sequence></xsd:complexType></xsd:element><xsd:complexType name="row"><xsd:sequence maxOccurs="unbounded" minOccurs="0"><xsd:element name="CATALOG_NAME" type="xsd:string" sql:field="CATALOG_NAME"/>
    <xsd:element name="CUBE_NAME" type="xsd:string" sql:field="CUBE_NAME"/>
    <xsd:element name="SET_NAME" type="xsd:string" sql:field="SET_NAME"/>
    <xsd:element name="SCOPE" type="xsd:int" sql:field="SCOPE"/>
    <xsd:element name="DESCRIPTION" type="xsd:string" sql:field="DESCRIPTION" minOccurs="0"/>
    <xsd:element name="EXPRESSION" type="xsd:string" sql:field="EXPRESSION" minOccurs="0"/>
    <xsd:element name="DIMENSIONS" type="xsd:string" sql:field="DIMENSIONS" minOccurs="0"/>
    <xsd:element name="SET_CAPTION" type="xsd:string" sql:field="SET_CAPTION" minOccurs="0"/>
    <xsd:element name="SET_DISPLAY_FOLDER" type="xsd:string" sql:field="SET_DISPLAY_FOLDER" minOccurs="0"/>
    </xsd:sequence></xsd:complexType></xsd:schema>
    </root></m:return></m:DiscoverResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
    Anyone know how to create/access this? If so, what tool (essmsh.exe, Administration Services?) is needed to do this?
    Thanks,
    J

    Yes you need to create one DSN connection and you have to use DSN name and login details at the time of building/loading of the outline.
    Create DSN
    Goto Administrative tools -> DataSources (ODBC) and add the DSN name and specify the Server name of SQL and login details and database.
    goto data prep editor and click on File Menu and Click on Open SQL option Next window opens.
    There you have to enter the details of the DSN connection and SQL query to build/load.
    Thanks,
    Prathap

  • Pivot table named sets

    Hi,
    I'm not sure if its a proper forum for my question but owing to the fact that the data I use come from PowerPivot I decided to post it here.
    I've been trying to use a named set feature to set columns for my data so it'd show: budget, actual, diff. In order to achieve this I've put accounts item to row fields, company, fiscal year and month in the report filter fields and a measure item
    (has two values: budget or actual) in the column field - twice. I've set the second one to display as difference (base field: measure, base item: budget). The table looked just fine but wanted to get rid of the empty column next to budget column. I thought
    I could use named sets for this. To do this I selected Create set based on column items and in the New set window I removed the second measurement for budget. After accepting the changes the table looked just as I wanted (budget, actual, diff in columns).
    Unfortunately, when I wanted to change the company in the report filter a message appeared saying that "the current session is not valid any longer due to structural changes in the data base" (translation from Polish to English). Refreshing the table
    causes all values to disappear. Am I doing something wrong here?
    My PowerPivot add-in version is 11.0.2100.60 and Excel 14.0.6112.5000.
    Kind regards
    -- Igor M.

    Did you ever manage to resolve this?

  • Excel - Cube Set & Cube Ranked Member Filtering

    Hi There,
    I am trying to get something working in excel but for the life of me can not seem to make it work. I am trying to calculate measures on a list of top 10 countries. These countries must be filtered to international and also have additional filters applied
    to them from related dimensions i.e. specific date, specific organisational unit etc. I can achieve this using a pivot table, however the top 10 list of countries need to dynamically change as the measures sums change.
    I have tried to accomplish this by using the cubeset and cuberanked formulas but can not apply dimension filtering (like cube value) which will result in incorrect values and country listings.
    Am I approaching this the wrong way or is it just not possible to do achieve this?
    I can not use pivot tables as I need a custom formatting solution in excel.
    Thanks.

    Hi shmick,
    According to your description, you want to filter the top 10 countries based on some measure. Right?
    In this scenario, I suggest you using TOPCOUNT() in MDX instead of using CUBESET and CUBERANKEDMEMBER in Excel. Please see my sample query below:
    So you can define a named set to always call the top 10 countries.
    WITH SET [Top10Countries] AS
    TOPCOUNT([Geography].[Country].[Country],2,[Measures].[Internet Sales Amount])
    If you have any question, please feel free to ask.
    Simon Hou
    TechNet Community Support

  • MDX question Named set

    Hai,
    This is my named set fomula in the cube (as 2008r2):
    subset
    (filter(descendants(period.period.year,1),VBA!Val(period.period.properties("id_"))<=VBA!Val(([period_now].item(0)).properties("id_"))),0)
    This shows>> Per1,Per2,Per3 etc.
    But now I want to show it like: Per3,per2,Per1 etc. How can I do that in the formula?
    Tnx for the information.

    Hi MYMY ,
    I would recommend to use the 'order' function (desc or asc depend on you per orde) .
    http://technet.microsoft.com/en-us/library/ms144767.aspx
    Regards, David .

  • SSAS - Named Set Grand Total

    Hi,
    I have a Calculation which I need to compute on fly. Index is the measure which will be product of Base Measure A and B divided by Sum(Measure A of
    selected Dimensions as shown in grey). I created Named set (Descendants) but had some difficulty in getting Total Measure A categorized based on selection.
    Please help me with calculated measure MDX script for the same for below output. Also the calculation script should work if just Product and Year are alone selected.
    Thanks in advance,
    Paddy

    Hi,
    check this link
    Conditional formtting in Grand total
    You can achive that by playing with XML in advanced tab.
    Regards,
    Sandeeep

  • Creating Named Set

    I am trying to create a named set that would return sum of selected members for any measure. When I deploy I am getting error "function
    expects a tuple set expression for the argument. A string or numeric expression was used". Please review my code and suggest solution. I have a dimension named Uline and this named set should sum selected 4 members of this dimension for any measure
    sum({[Uline].[CU - (46)],
    [Uline].[FRU - (45)],
    [Uline].[GL - (38)],
    [Uline].[PU - (44)]},[Measures].CurrentMember)
    Thank you for your help

    Try 
    Aggregate(
    {[Uline].[CU - (46)],
    [Uline].[FRU - (45)],
    [Uline].[GL - (38)],
    [Uline].[PU - (44)]}
    Richard

  • Not able to access the result set from one member function to another

    Im new to jdbc
    I have declared a connection object , a result set object and statement object in one member function and i am not able to access these in another member function. But both are in the same class
    Kindly help
    Thanks
    Shasi

    Kindly refrain from double-posting:
    http://forum.java.sun.com/thread.jspa?threadID=700659&tstart=0
    - Saish

  • Attribute key cannot be found. Value 0 . eventhough set to unknown member

    Hi,
    I want to be able to set any null values in the fact foregin key to the dimensions unknown member.
    I have a dimension called agent , with UnknownMember = True and UnknowMemberName = No Agent. When I process my dimension, I see all my agents plus a No Agent member. (ErrorConfiguration = Default. I do not want to ignore errors ).
    In the cube dimension usage I've set null proccessing to unknown member.
    I have a rows on my fact table with NULL on the agentID and the Cube fails to process with this error (its changing NULL to 0):
    Errors in the OLAP storage engine: The attribute key cannot be found when processing: Table: 'dbo_FactSales', Column: 'AgentId', Value: 0.
    I was expecting that, based on my configuration of the dimension, that the NULL row would be assigned to the unknown member of the dimension.
    What am I missing?
    (I know that I could have a Unknow record on my db and deal with it on the ETL process, but I would like SSAS to handle this situation. I already read 
    http://msdn.microsoft.com/en-us/library/ms345138.aspx is telling to do on the section "Referential
    Integrity Issues in Fact Table")
    I don't know if this is related but the fact value is taken from DSV query of:
    CASE WHEN Fact_table.[AgentId] IS NULL THEN NULL ELSE CAST(Fact_table.[AgentId] AS INT) END AS [AgentId]
    Your help appreciated
    Namnami

    Hi Namnami,
    Please refer to the following article:
    Defining the Unknown Member and Null Processing Properties:
    http://technet.microsoft.com/en-us/library/ms170707(v=sql.90).aspx
    Here is a related article about this error message for your reference:
    SSAS Quick Reference: Attribute Key Cannot Be Found:
    http://toddmcdermid.blogspot.com/2009/01/ssas-quick-reference-attribute-key.html#!/2009/01/ssas-quick-reference-attribute-key.html
    Regards,
    Elvis Long
    TechNet Community Support
    The worst part about these MSDN forums is that the Moderators seem to just want to mark an answer correct on every single question whether it's right or not, and if there is no answer they just mark their own answers as correct, even when it's as unhelpful
    as "Here's the same link to the article you've already read".

  • Ordering MDX query wih Named set gives error, "The CURRENT function cannot be invoked in this context ".

    Hi,
    I have following Query 
    WITH SET [Union name set test] AS {[Union].[Union Name].&[2],[Union].[Union Name].&[3],
    [Union].[Union Name].&[4],[Union].[Union Name].&[5],[Union].[Union Name].&[6]}
    SELECT {[Measures].[Emp Count]} ON 0,  
    {ORDER({[Union].[Union City].[Union City]*[Union name set test]}, 
    [Union name set test].CURRENTMEMBER.MEMBERVALUE, BASC)} ON 1 FROM [Federations];
    when i run this query from code as well as SSMS i get following error...
    The CURRENT function cannot be invoked in this context because the 'Union name set test' set is not in the scope.
    Please help me for this ....

    Hi Mihirhp,
    Base on my research, there are some similar issues and the resault turn out that the Tabular model engine can’t associate .currentmember with a set. The workaround  is to use .current in the MDX query. Please try the query below.
    WITH SET [Union name set test] AS {[Union].[Union Name].&[2],[Union].[Union Name].&[3],
    [Union].[Union Name].&[4],[Union].[Union Name].&[5],[Union].[Union Name].&[6]}
    SELECT {[Measures].[Emp Count]} ON 0,
    {ORDER({[Union].[Union City].[Union City]*[Union name set test]},
    [Union name set test].CURRENT.MEMBERVALUE, BASC)} ON 1 FROM [Federations];
    Hope this helps.
    Regards,
    Charlie Liao
    TechNet Community Support

Maybe you are looking for