SUM distinct in SSAS Cube measure

Hi All,
I am new to SSAS. I am building a cube. I have many to many relationship.
The fact table is structured as below
FactMain:
DataSetId   TotalCost
Data
101   100.00
102   200.00
FactBridge:
DataSetId    CodeKey   CodePosition
Data:
101     1   1
101     1   2
102     5   1
DimCode:
CodeKey   CodeDescription
1        Code1
2        Code2
5        Code 5
If I am browsing the cube for Code1
I am getting TotalCost doubled. (200.00) Actually I need to get 100 only as it is same DataSetId
How can I get SUM(TotalCost) for distinct DataSetIds?

Hi Rajkm,
According to your description, you want to sum the value for distinct dataset. Right?
In this scenario, since you build the relation between main and bridge table, it will have two records for code1. So when you calculate the total cost on code dimension, it will definitely aggregate the value for each CodeKey. So your requirement
can't be achieved. If you want to keep only one value for each code, you should not have that bridge table in you dsv when building your cube.
If you have any question, please feel free to ask.
Simon Hou
TechNet Community Support

Similar Messages

  • How to get sum distinct in the cube. Is it possible.

    Here is the scenario.
    One report has many countries on it but only one amount.
    For a particular day we have the following data in the fact.
    TRANSACTION_DAY_NO
    Country
    Total Amount
    19900101
    US
    34
    19900101
    IND
    35
    19900101
    IND
    36
    19900101
    AUS
    37
    19900101
    UNKNOWN
    38
    19900101
    UNKNOWN
    39
    19900101
    UNKNOWN
    40
    19900101
    UNKNOWN
    41
    19900101
    UNKNOWN
    42
    19900101
    UNKNOWN
    43
    19900101
    US
    43
    19900101
    IND
    42
    There are 2 dimensions on the cube.
    Date, Country.
    I am not sure how to build a cube on this data.
    with t as (
    select 19900101 transaction_Day_no,     'US' country_no,     34 total_amount from dual union all
    select 19900101,    'IND',         35  from dual union all
    select 19900101,    'IND',         36  from dual union all
    select 19900101,    'AUS',         37  from dual union all
    select 19900101,    'UNKNOWN',    38  from dual union all
    select 19900101,    'UNKNOWN',    39  from dual union all
    select 19900101,    'UNKNOWN',    40  from dual union all
    select 19900101,    'UNKNOWN',    41  from dual union all
    select 19900101,    'UNKNOWN',    42  from dual union all
    select 19900101,    'UNKNOWN',    43  from dual union all
    select 19900101,    'US',    43  from dual union all
    select 19900101,    'IND',    42  from dual
    select transaction_day_no, country_no, sum(distinct total_amount) from t
    group by cube(transaction_Day_no, country_no);
    I am using AWM. I have tried to build by selecting the following aggregate for the cube
    max for the country_no and
    sum for the tranaction_Day_no
    But i am getting incorrect results.
    If i select sum for both country_no and transaction_no then also i get incorrect results.
    Please help me solve this issue.
    thanks

    Thanks for all your reply's.
    The problem is that i have duplicates because
    One report can have many customers.
    One customer can have many countries.
    One customer can have many reports.
    If i include the report number in the above data and do a sum on both day and report_number and max for everything else then everything is find and i am getting correct results.
    But if i take out the report dimension then i am stuffed.
    Also the problem is that i can't have one big dimension for the report as the number of reports are in access of 300M
    We have tried to solve this issue by having the fullowing.
    Dummy Cube.
    This has all the combination of all the dimension in the fact table with the report dimension as only one row(-1)
    Report Dimension for each Quarter(34M rows each)
    Quarter Cube is build.
    Then add the values from all the Quarter Cube with the Dummy Cube.
    Tried for 2 Quarter and its working fine results are correct as well.
    Only problem is that its taking a long time to build the cube because of the report dimension.
    I am trying to find a way to remove the report dimension but still use it. As we only use report dimension at level 'ALL'
    But if we do aggregation at 'ALL' level the answers are wrong again.
    Thanks for looking into this and taking time to reply.
    Regards
    Alvinder

  • SSAS Cube Measures will not display for all associated dimensions in Excel client

    Dear All,
    Can you please clarify the below query to me?
    I have one Calculated Member CM1 and the expression used to calculate is:
    ([Dimension1].[HierarchyName1].CURRENTMEMBER.Prevmember,[Measures].[Amount]) associated to a Measure Group MG1.
    Dimension1 is having two Hierarchies HierarchyName1 and HierarchyName2.
    Measure CM1 is used to Calculate another calculated Member CM2 along with other Non Calculated measures and associated to the same Measure Group MG1.
    And the Measure Group MG1 is linked to other dimensions, Dimension2 and dimension3 as well.
    When I query the cube in Excel Client for the measure CM2, values appears only when the dimension Dimension1.HierarchyName1 is used to view the results.
    And values do not appear:
      When I do not use any dimensions (Only CM2 used to display in the excel)
      When I use Other dimensions linked i.e. Dimension2 and dimension3
      And Also does not display any values if the CM2 is used along with other hierarchy of same dimension1 i.e. HierarchyName2
    I don understand this concept OR Is this the concept how the tuples work in SSAS MDX?
    If a Calculated measure is created using a one of Dimension member, cannot we view that measure value along with other dimensions linked or when we do not use any dimension to view the results in excel?
    Can you please help me to understand this.
    Thanks in Advance and Regards.

    As you explained CM2 depends on CM1.
    The dependency for CM1 is "[Dimension1].[HierarchyName1].CURRENTMEMBER.Prevmember".
    So to get value for CM1 you need to bring HierarcyName1.
    So for CM2 also HierarcyName1
    has to be used only then the data will be visible. When HierarcyName1 is used you can play with
    the combinations of other dimension as well .
    http://www.bifeeds.com

  • Sum Distinct for a measure object

    Hi,
    Can anybody let me know how to go ahead and get a sum distinct for a particular measure object in a Universe?

    If your database supports the syntax, you can simply use SUM(DISTINCT table.measure_column) and it should apply the distinct function. Note, however, that this can result in under-reporting certain values. For example, assume you have two sales orders with the same amount: $100. As long as you include the order number (or primary key order_id or otherwise) you will get a total of $200. But if you remove order number, the sum(distinct) will see two equal values (both $100) and your total will only be $100 instead of the correct answer $200.
    What is the real problem you are trying to solve?

  • Powerview modifying a calculated measure in SSAS cube

    We are running SQL Server 2012 and Sharepoint 2013 we are having problems with Powerview modifying a calculated measure in the underlying multidimensional cube. We have a powerview report with multiple pages that allows a user to utilize a global filter
    to view the financial performance of particular customers on multiple reports/pages. When the user picks a different customer, one of the calculated measures, in this case gross margin percent, is essentially stuck. It does not change when the customer selection
    changes. It remains the gross margin percent as the previous customer. All of the other measures change appropriately. Measures such as sales, expenses, ebitda and the other measures that are columns in the relational sql server db feeding the cube are fine.
    Only the calculated measures defined in ssas are not working. I then tested the molap cube on a clean connection to a new excel sheet and was shocked to find that the same value the power view report is stuck on is also displayed in the excel file!  It
    has essentially modified the data in the cube!  The only way to clear the value and display the correct calculation is to re deploy the cube. Any one here know what to do to resolve this?

    Hi Osu75,
    According to your description, you create a PowerView report using SSAS cube as the data source in SharePoint site, the problem is that when changing the selection in the global filter, it change the calculated measure in the underlying multidimensional
    cube, right?
    In your scenario, which script are you using when creating this calculated measure?  Generally, report is used to display data from underlying database, it's really strange that the PowerView report change the calculated measure in the underlying multidimensional
    cube.
    From a support perspective this is really beyond what we can do here in the forums. If you cannot determine your answer here or on your own, consider opening a support case with Microsoft. Visit this link to see the various support options that are available
    to better meet your needs:
    http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here.
    Charlie Liao
    TechNet Community Support

  • Insert SSAS Cube records measure and dimensions to relational table

    Hi,
    I need to retrieve one measure with a couple of its related dimensions from an ssas cube and have it stored in SQL table. How could this be done?
    In order to read data from cube and insert into SQL relational table
    this thread says to use openquery but states that it will only work if there are measures on the columns
    and no dimensions on columns.
    Is there a way to query a measure with a couple of its related dimensions
    in MDX using openquery? Or any other way to query the cube to get these into SQL?
    (Or should I better get the data from the base SQL tables which the cube is built from?)
    Thanks for advising
    Namnami

    Hi Namnami,
    Sure Darren Gosbell thread will help you, you can try below things.
    You can get more info on
    this link
    Basically to write SQL+MDX combined we have to create link server from where we want data to combine with SQL. To create link server you need to have Admin access to the SQL Server.
    IF IS_SRVROLEMEMBER ('sysadmin') = 1
    print 'Current user''s login is a member of the sysadmin role'
    ELSE IF IS_SRVROLEMEMBER ('sysadmin') = 0
    print 'Current user''s login is NOT a member of the sysadmin role'
    ELSE IF IS_SRVROLEMEMBER ('sysadmin') IS NULL
    print 'ERROR: The server role specified is not valid.'
    Above Query returns the whether you have admin admittance to the server or not to create Link Server.
    More Details on Hybrid Query-
    USE
    AdventureWorksDW2008R2
    GO
    EXEC
    sp_addlinkedserver
    @server='Test',
    @srvproduct='',
    @provider='MSOLAP',
    @datasrc='localhost',
    @catalog='Adventure Works DW 2008R2'
    Declare @MDXExpression as Varchar(MAX)
    Select @MDXExpression =
    SELECT
    NON EMPTY
    [Measures].[Sales Amount]
    ,[Measures].[Standard Product Cost]
    ,[Measures].[Tax Amount]
    ,[Measures].[Total Product Cost]
    } ON 0,
    NON EMPTY
    [Sales Channel].[Sales Channel].[Sales Channel]
    } ON 1
    FROM
    [Adventure Works]
    Exec ('SELECT * INTO ##TestTemp FROM OpenQuery(TestTest1,''' + @MDXExpression + ''')')
    SELECT
    CONVERT(varchar,t."[Sales Channel].[Sales Channel].[Sales Channel].[MEMBER_CAPTION]") AS [Date],
    (CONVERT(nvarchar,t."[Measures].[Sales Amount]")) AS [Sales Amount],
    (CONVERT(nvarchar,t."[Measures].[Standard Product Cost]")) AS [Standard Product Cost],
    (CONVERT(nvarchar,t."[Measures].[Tax Amount]")) AS [Tax Amount],
    (CONVERT(nvarchar,t."[Measures].[Total Product Cost]")) AS [Total Product Cost]
    from
    ##TestTemp t
    --DRop Table ##TestTemp
    Query Execution-
    1-     
    So above query first creates liked server with named as 'Test'.
    2-     
    After that MDX query executed on linked server where we have kept the MDX query in MDXExpression variable.
    3-     
    Using OpenQuery function data gets dump in to ##TestTemp table.
    4-     
    Finally we get the data from ##TestTemp table.
    Thanks,
    Mark as Answer if this resolves your problem or "Vote as Helpful" if you find it helpful.
    My Blog
    Follow @SuhasKudekar

  • Distinct count inside a measure group with other measures

    Hello,
    I have 1 distinct count inside a measure group with other measures, sum, count etc. I know this is not recommended due to poor processing performance and query response time.
    Processing performance I can live with if it means not having another measure group, which increases processing time anyway.
    I have used the recommended approach before and it generated many questions about what this second measure group is for (visible via excel), even though I made the distinct count appear in the main measure group via a calculated measure.
    (it would be nice if you could hide measure groups)
    However my question is: is query response time only effected when the distinct count is used in the query? Or is query response time effected regardless if the distinct count is used or not??
    Below is an extract from the 2005 distinct count optimizer white paper. It’s not completely clear but I assume if effects queries regardless if distinct count is used or not?
    "By adding other measures to the measure group holding a distinct count measure, all of the other measures will be at the same granularity as the distinct count measure, resulting in inefficient data structures and suboptimal
    queries."

    You might also be interested in reading this blog post, which deals with a similar scenario, to get a feeling for some of the things that might be going on behind the scenes:
    http://cwebbbi.wordpress.com/2012/11/27/storage-engine-caching-measures-and-measure-groups/
    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

  • Date parameter in report whose source is SSAS cube shows all dates in DimDate?

    My cube consists of a FactTable that has a foreign key to [DimDate], through column [DateKey]. My DateKey has dates from
    20010101 to 20201231. My fact table only has data from today (20141017). 
    In SSRS, I add the dimension Dim Date, Date Key as parameter. When I run the report, everything runs great, the only problem being that the date dropdown shows all the
    DateKeys from [DimDate] (20010101 to 20201231).
    How can I only show in the dropdown parameter only the DateKeys that have actual data? In this case, the parameter would only only display 20141017.
    Thanks.
    VM

    Thanks, but I don't think you read the whole question. 
    I'm using as datasource an SSAS cube. The query that populates the parameter looks like this:
    WITH MEMBER [Measures].[ParameterCaption] AS [Dim Date].[Date Key].CURRENTMEMBER.MEMBER_CAPTION MEMBER
    [Measures].[ParameterValue] AS [Dim Date].[Date Key].CURRENTMEMBER.UNIQUENAME MEMBER
    [Measures].[ParameterLevel] AS [Dim Date].[Date Key].CURRENTMEMBER.LEVEL.ORDINAL
    SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS ,
    [Dim Date].[Date Key].ALLMEMBERS ON ROWS FROM [Sales cube]
    VM

  • Using FORMAT_STRING from SSAS cube - not working consistently

    Here's the deal.  
    I've got an SSAS cube and I am scoping the format of the measures based on dimension members. 
    Like this.
    scope(( [Account].[Level 5].&[I000900000] )); 
    format_string(This) = "(#,0,);#,0,";   
    end scope; 
    I'm then calling this format in the SSRS report using typical SSRS trickery and hacks.  
    Well. When I run the report for one date (this is a GL financial cube), this works perfectly.  When I run the report for a different date, it all of a sudden doesn't work.  When I view the data in excel through a pivot table, everything is fine.
    It's driving me crazy.  Has anyone else experienced something like this.

    Hi Baracus,
    Thank you for your question. 
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. 
    Thank you for your understanding and support.
    Regards,
    Charlie Liao
    TechNet Community Support

  • SSRS Report date parameter values using SSAS Cube as datasource

    Hey Guys, 
    i m building an SSRS report using SSAS cube as the data source. The report contains shared data-sets which provide the required data. below is the set up.
    Sql server version : Sql server 2008R2
    Report builder 3.0 
    I have, Report A, powered by Dataset D, running on Cube C. The dataset has 3 parameters out of which one of them is a date parameter- P1. I have it set up such that on the report there is  another parameter - P2 which contains the type as Date ( to
    ensure the user is exposed to a date picker), the input from this, P2 is then manipulated to required format before fed into the dataset parameter P1 (hidden). I have two questions regarding this parameter.
    Currently, when the user pick's a date (P2) which has no values, the report errors out as it doesn't find that corresponding member on the cube. Can it be made such that if the member doesn't exists, a simple error message like "date not found"
    pops up as opposed to report failing?
    Secondly, can i manipulate the date picker (P2) exposed to the user such that the unavailable dates are grey'ed out on the date parameter (P2)? 
    Please let me know if there is any more info required on each of the questions.
    Thanks
    Srikanth

    Hello Katherine,
    below are the errors which pop up with the 'Constrained' function in place and without. The MDX query is what follows.
    Without: 
    An Error has occurred during report processing. (rsProcessingAborted). The Execution Failed for the shared data set “Dataset1”.(rsDataSetExecutionError). Query Execution failed for dataset ‘DataSet1’. (rsErrorExecutingCommand). The dimension ‘[10 Sep 2014]’
    was not found in the cube when the string, [10 Sep 2014], was parsed.
    With Constrained flag:
    An Error has occurred during report processing. (rsProcessingAborted). The Execution Failed for the shared data set “Dataset1”.(rsDataSetExecutionError). Query Execution failed for dataset ‘DataSet1’. (rsErrorExecutingCommand). Query(1,1476) The restrictions
    imposed by the CONSTRAINED flag in the STRTOSET function were violated.
    SELECT
    NON EMPTY
    [Measures].[A]
    ,[Measures].[B]
    ,[Measures].[C]
    ,[Measures].[D]
    ,[Measures].[E]
    } ON COLUMNS
    ,NON EMPTY
    [DimA].[LevelA].[LevelA].ALLMEMBERS*
    [DimB].[LevelB].[LevelB].ALLMEMBERS*
    [Date].[Date].[Date].ALLMEMBERS
    DIMENSION PROPERTIES
    MEMBER_CAPTION
    ,MEMBER_UNIQUE_NAME
    ON ROWS
    FROM
    SELECT
    StrToSet (@FilterA ,CONSTRAINED) ON COLUMNS
    FROM
    SELECT
    StrToSet(@Date, CONSTRAINED) ON COLUMNS
    FROM [Cube1]
    WHERE
    [DimC].[Level1].&[Member1]
    ,[DimC].[Level2].&[Member1]
    ,[DimC].[Level3].&[Member1]
    ,[DimC].[Level4].&[Member1]
    Thanks
    Srikanth

  • Slow parameter from SSAS cube

    Hi,
    I've got a SSRS report which use a SSAS cube as source. In the report there are 5 parameters which are build in the Report builder 3.0 using the designer.  The report server is a SQL server 2008 R2 with the latest updates.
    The issue that I am having is when running the report if I would like to choose another value from one of my parameters then I open the parameters (drop-downbox)and select another value in the box - then it's like the drop-down box hangs for 3-4
    seconds when I click out of the box before the value is appearing in the report, when I use the Report builder Tool. If I do the same in IE then the reports render for 10-15 seconds each time a new value is choosen.
    Any Idea how to improve this?
    The Parameter consist of only 5-6 values and it performs very fast if I execute the Query in the designer
    I've attached the Query as it looks like for the parameter(hidden dataset):
    WITH MEMBER [Measures].[ParameterCaption] AS [Company].[Company Name].CURRENTMEMBER.MEMBER_CAPTION MEMBER [Measures].[ParameterValue] AS [Company].[Company Name].CURRENTMEMBER.UNIQUENAME MEMBER [Measures].[ParameterLevel] AS [Company].[Company Name].CURRENTMEMBER.LEVEL.ORDINAL
    SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , [Company].[Company Name].ALLMEMBERS ON ROWS FROM ( SELECT ( STRTOSET(@ReportingCurrencyReportingCurrency, CONSTRAINED) ) ON COLUMNS FROM [SALES])
    (the issue is the same for all my parameters)

    Hi HCMJ,
    In your scenario, you said that "the reports render for 10-15 seconds each time a new value is choosen".
    Report server performance is affected by a combination of factors that include hardware, number of concurrent users accessing reports, the amount of data in a report, and output format.
    To find out how long it takes to process a report and which process phase take more time, we can review the report server execution log. We can use the report execution log to find out how often a report is requested, what formats are used the most, and
    how many milliseconds of processing time is spent on each processing phase.
    In addtional, i'd suggest you enable SQL Sever profiler to monitor the queries fired by the report, once you find some queries took a very long time to run, consider creating the smaller cube partition or optimzing the query by adding index or
    partition to improve the query performance.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Cache and performance issue in browsing SSAS cube using Excel for first time

    Hello Group Members,
    I am facing a cache and performance issue for the first time, when I try to open a SSAS cube connection using Excel (using Data tab  -> From Other Sources --> From Analysis Services) after daily cube refresh. In end users
    system (8 GB RAM), for the first time, it takes 10 minutes to open the cube. From next run onwards, its open up quickly within 10 secs.
    We have daily ETL process running in high end servers. The configuration of dedicated SSAS cube server is 8 core, 64GB RAM. In total we have 4 cubes - out of which for 3 is full cube refresh and 1 is incremental refresh. We have seen after
    daily cube refresh, it takes 10 odd minutes to open the cube in end users system. From next time onwards, it opens up really fast with 10 secs. After cube refresh, in server systems (16 GB RAM), it takes 2 odd minutes to open the cube.
    Is there, any way we could reduce the time taken for first attempt ?
    Best Regards, Arka Mitra.

    Thanks Richard and Charlie,
    We have implemented the solution/suggestions in our DEV environment and we have seen a definite improvement. We are waiting this to be deployed in UAT environment to note down the actual performance and time improvement while browsing the cube for the
    first time after daily cube refresh.
    Guys,
    This is what we have done:
    We have 4 cube databases and each cube db has 1-8 cubes.
    1. We are doing daily cube refresh using SQL jobs as follows:
    <Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
    <Parallel>
    <Process xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200">
    <Object>
    <DatabaseID>FINANCE CUBES</DatabaseID>
    </Object>
    <Type>ProcessFull</Type>
    <WriteBackTableCreation>UseExisting</WriteBackTableCreation>
    </Process>
    </Parallel>
    </Batch>
    2. Next we are creating a separate SQL job (Cache Warming - Profitability Analysis) for cube cache warming for each single cube in each cube db like:
    CREATE CACHE FOR [Profit Analysis] AS
    {[Measures].members}
    *[TIME].[FINANCIAL QUARTER].[FINANCIAL QUARTER]
    3. Finally after each cube refresh step, we are creating a new step of type T-SQL where we are calling these individual steps:
    EXEC dbo.sp_start_job N'Cache Warming - Profit Analysis';
    GO
    I will update the post after I receive the actual im[provement from UAT/ Production environment.
    Best Regards, Arka Mitra.

  • Calculate percent difference of revenue dollars between company a and company b in SSAS cube

    New to the world of SSAS cubes.  Here is my scenario... I have company A that has revenue R for a given month.  I have company B that has revenue S for the same month.  I have Company C that has revenue T for the same month.  I need
    to calculate the pct difference between revenue R vs S, and R vs T, for each month.  Can this be done in a SSAS cube?  Thanks in advance.

    hi,
    Hereunder one idea that went through my mind. But there is room for improvement.
    Feel free to replace the pct formula with your own conception of it.
    I didn't clutter it with the usual nullity test that you can find in the documentation on the internet.
    No company dimension in AW so i took country instead:
    WITH
    MEMBER [Measures].[Pct vs] AS
    [Customer].[Country].currentmember.nextmember.name
    MEMBER [Measures].[Perct vs] AS
    [Customer].[Country].currentmember.nextmember.nextmember.name
    MEMBER [Measures].[Sales next member] AS
    ([Customer].[Country].currentmember, [Measures].[Internet Sales Amount]) / (
    [Customer].[Country].currentmember.nextmember,
    [Measures].[Internet Sales Amount])
    MEMBER [Measures].[Sales 2nd next member] AS
    ([Customer].[Country].currentmember, [Measures].[Internet Sales Amount]) / (
    [Customer].[Country].currentmember.nextmember.nextmember,
    [Measures].[Internet Sales Amount])
    SELECT
    [Measures].[Internet Sales Amount],
    [Measures].[Pct vs],
    [Measures].[Sales next member],
    [Measures].[Perct vs],
    [Measures].[Measures].[Sales 2nd next member]
    } ON 0,
    [Date].[Calendar].[Month].&[2007]&[1],
    [Date].[Calendar].[Month].&[2007]&[2]
    [Customer].[Country].[Country]
    } ON 1
    FROM [Adventure Works];
    Hope this will inspire you !
    Philip

  • Adding WHERE condition in "Calculations" tab of SSAS Cube Designer

    HI,
    I am using SSAS 2012 version to develop SSAS cube
    and need help on following scenario :
    In the BIDS designer, on the Calculations tab: 
    I am creating one calculated member called [% Jobs] for which I am writing MDX expression as below :
    '([Measures].[On Time jobs]/[Measures].[Total Jobs])*100'
    Till here all is well... 
    Now, How do I implement here WHERE condition ? 
    For ex., in my fact table I have a column Line_Number
    I want to implement above MDX expression such that it only considers Line_Number=1
    while doing the above calculation.
    Hope it is clear. 
    Thanks...

    I tried with below method :
    While keeping the expression as it is :
    '([Measures].[On Time jobs]/[Measures].[Total Jobs])*100'
    What I did was in the partition tab, i choose option "Query binding" (instead of Table binding) and over there I mentioned the condition 
    WHERE Line_Number=1
    So it should do the calculations only for the first line.
    Is this approach also correct ?
    Thanks 

  • Calculations with Sum Distinct Aggregations

    Hi,
    I got a problem. I use in one of my analysis a Pivot Table. One of my measures which I sum up has multiple entries in my tables. So I decided to use a Sum Distinct aggregation. The Sum Distinct aggregation works perfect. But when I want to do basic calculations with the measure I get wrong results. It seems that in the calculation the aggregation is just a SUM and not a Sum Distinct. In the calculation I subtract the measure from a constant. But I only get wrong result with the redundant entries.
    Pivot table:
    Name --- Days available --- Days worked (measure)--- Days left (= Days available minus Days worked)
    Mr. A --- 60 --- 5 ---- 55
    Mr. A --- 60 --- 10 --- 50
    Mr. A --- 60 --- 35 --- 25
    ---------- Sum ---- 50 --- -45 (wrong result)
    Is there a solution to this problem?
    thx
    Edited by: Backlit on 31.07.2011 11:29

    Hi,
    and thx for the quick answer. But unfortunately the Server Complex Aggregate aggregation doesn't solve my problem. I also think I didn't express my self clear enough.
    My problem is, that I have the same tuple multiple times in my database table. When I sum this data up - I get wrong results. To avoid this I used the SUM DISTINCT aggregation. This worked very fine. But now I'm facing an other problem. I have to perform a simple subtraction.
    I have a fixed non measure value. I have to subtract the Sum Distinct measure from this fix value for a specified time periode.
    it looks like this:
    Pivot table
    Name --- Days available(non measure) --- Work date --- Days worked (SUM) measure --- Days worked SUM(Distinct) measure
    Mr.A --- 40 --- 1.5 --- 6 --- 3
    Mr.A --- 40 --- 1.5 --- 6 --- 3
    Mr.A --- 40 --- 2.5 --- 6 --- 3
    Mr.A --- 40 --- 3.5 --- 6 --- 3
    Mr.A --- 40 --- 3.5 --- 6 --- 3
    Mr.A --- 40 --- 3.5 --- 6 --- 3
    SUM ---- 40 --- .... ---- 6 --- 3 -> Days left: 34 (wrong result - should be 37)
    I get the right result - but when I now try to calculate "Days available - Days worked SUM(Distinct)" I get the same results like I would do the calculation with
    "Days available - Days worked SUM".
    And is there a way to hide the multiple values in Days worked?
    thx

Maybe you are looking for

  • Requirements Gateway - Searching for requirements in table rows in a Adobe PDF file

    In my quest for creating a good understanding of the coverage of requirements of my test cases I download the NIRG (NI Requirements Gateway) and started out importing my SRS (System Requirement Specifications) documents and some of the test cases. Th

  • How to connect MBP to WIDI

    I have following MBP, MacBook Pro   Model Identifier:          MacBookPro10,1   Processor Name:          Intel Core i7   Processor Speed:          2.6 GHz Display INTEL HD4000 NVIDIA GeForce GT 650M:   Chipset Model:          NVIDIA GeForce GT 650M  

  • Extraction Good Receipt lines without Invoice posting

    Dear, Is there a possibility to extract the open GR items for which no Invoice has been posted via MIRO transaction ?

  • Intercepting Excel Add-In Requests

    <p>I'm trying to intercept Excel Add-In requests before they aresent. Basically, every time a user retrieves data or executes aLinked Reporting Object, I want to execute a piece of VBA code.</p><p> </p><p>I think this functionality is implemented in

  • Does Anyone Make A Leather iPad mini Smart Cover (Not a Case)

    I'm looking for a leather smart cover for the iPad mini (not a case that also covers the back). Does anyone make one?