SSAS Cube - Level Metric

Hi Team,
How can I create Measure on Field1 (Device_ID) based on Field2(Device_Type) of same Dimension.
I want to create few Measures as given below.
Measure 1 : Count (Distinct  Devices_Id ) Which are Type 0
Measure 2 : Count (Distinct  Devices_Id ) which are Type 1
Measure 3 : Count ( Distinct Devices_Id ) which are Type 2
I have below Dimension table to create above measures.
Dim_Device (Device_SK, Device_id, Type)

All Dimension Tables used Are : Dim_Device ,Dim_Coverage,Dim_Customer,Dim_Location
No Fact Tables here, Only Bridge Tables we have used for below sql/measure: B_Customer_Location_Coveraget ,B_Coverage_Device
Logic :I want measure on report which will be "Count of Devices", I will get that value after slicing data by Customer, Location, Agreement, Date, hence I have setup relationship between these dimension tables to my Bridge Tables.
So,  After slicing data by above dimension, I should get Count of Device_Id's which are of the Device_Type 0
Note : Earlier I had Power Pivot DAX expression, out of BISM Tabular Cube Model: Wherein All above dimensions are related to Bridge Tables.
And now, as per project need, we have migrated from Tabular Cube to Traditional Multidemsional OLAP Cube.
Here, for each time to get measure value my "where" clause should come into picture.
select  count(distinct dimAss.Asset_ID)
, DAC.Account_Name,G.City
from  B_Coverage_Device BAA
left outer  Join B_Customer_Location_Coverage BAGA on BAA.Coverage_Sk = BAGA.Coverage_Sk
inner join Dim_Coverage DimAgr on BAA.Coverage_Sk = DimAgr.Coverage_Sk
inner JOIN Dim_Device dimAss on BAA.Device_SK = dimAss.Device_SK  
inner join Dim_Customer DAC on BAGA.Customer_SK = DAC.Customer_SK 
inner join Dim_Location G on G.Location_SK = BAGA.Location_SK
where (BAA.Coverage_Start_Date is not null or bAA.Coverage_End_Date is not null)
  and DAC.Customer_SK is not null
  and dimAss.Device_SK is not null
  and DAC.Account_Aggregate = 'AMGEN INC'
    and (dimAss.Device_Type = 0)
   and (BAA.Coverage_End_Date >=cast('2013-12-01  00:00:00.000' as datetime)
   and  BAA.Coverage_End_Date <=  cast('2013-12-31  00:00:00.000' as datetime))
Group by DAC.Account_Name,G.City

Similar Messages

  • SSAS cubes - fragments

    Hi,
    Hoping someone can help. I have defined a logical model over the top of a set of SSAS cubes in a single SSAS database. This consists of a summary cube and detailed cubes that relate to individual products. I would like to have a "Product" dimension that will allow the user to drill between the products and for dimensions at lower levels of granularity (i.e. that are only relevant to one product) data should be sourced from the relevant detailed cubes. Unfortunately although the summary cube has a product dimension the detailed cubes don't - when I try to map the detailed cube to the product dimension using an expression I get the following error message: "Target data source does not support the Complex Expression operation."
    e.g.
    Product Dimension has 3 products in it: Bikes, Cars and Boats. There is a summary cube that contains all 3 products and has the Product dimension defined.
    There are 3 detailed cubes for Bikes, Cars and Boats that don't have a product dimension. In my mappings for the Product Name attribute of the Product dimension I have the following:
    Logical Table Source..... Mapped As
    SummaryCube..... Product.Product
    BikeCube... 'Bikes'
    CarCube... 'Cars'
    BoatCube.. 'Boats'
    Hope this explains it. I get the error message whenever I'm trying to get data from the detailed level cube.
    Thanks,
    Rob

    Hi Platt,
    By default, the default account for AS services 'NT Service\MSSQLServerOLAPService' has only public permission to few databases. If you haven't change the AS services account, or haven't grant the permission for this account, then you cannot deploy
    the AS project to server.
    So in your scenario, ensure the service "SQL Server Analysis Services" is running with a proper Log On As user. This user should have administrator permission on Analysis Services and the proper permissions on the database engine. To avoid this
    issue, you can grant the SELECT permission for the default account for AS services to data source DB. Or you can change the services account to this domain user who has the corresponding to the data source DB.
    http://jetreportskb.host4kb.com/article/AA-00238
    http://msdn.microsoft.com/en-in/library/ms175371.aspx
    Regards,
    Charlie Liao
    TechNet Community Support

  • 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

  • Service Not Available error with SSAS cube

    Hi,
    We imported Microsoft Analysis Services (SSAS) Cube into RPD using XMLA.  While using the drill down feature in BI answers using presentation hierarchies, OBIEE is generating the following error
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: URL: http://<server>/<app name>/msmdpump.dll. The http return status is 503.< html><head><title>Service Not Available</title></head><body>Service Not Available</body></html>
    However, drill down feature is working fine with attribute columns. Also the report is working fine up to certain level of drill down. In the log it is evident that OBIEE is generating multiple physical queries (with clause) to pull the data from the cube.
    Is there any limit on the size of the mdx or number of mdx queries that msmdpump.dll can process?  Is there any configuration that needs to be modified while working with SSAS cubes?
    OBIEE version: 11.1.1.6.2 BP1
    Much appreciate your time.

    Hi Dhar,
    Thanks for your reply.
    Yes, your observation is correct. Changing the type of the hierarchies has some effect on the issue. I'm able to drill down to few more levels as the MDX generated by OBIEE in this less complex. But ultimately I'm facing the same issue after certain stage. I can only think of, the number of physical queries generated by OBIEE, as one of the possible reason for this. What is your opinion?
    Interestingly, I tested the same RPD in 11.1.1.6.5 and I'm unable to reproduce in the issue so far in my testing . Is it a bug in 11.1.1.6.2?! However, upgrading to 11.1.1.6.5 is not an option for us at this stage.
    Were you able to resolve the issue completely by only changing the hierarchy type? What version you have used in you project?
    Thanks.

  • Using Non BI database as source to Build SSAS cubes and SSRS reports .

    hi,
    I have a requirement where I have to use existing database(OLTP) as my source to the SSAS cubes and then to build the reports.
    Where for Cubes and Reports I uses SQL Server BI edition. But my existing source data will be in non BI database.
    My questions are
    1) Can I create Fact and Dimension Model in Non BI Db and connect the same to SSAS and SSRS? What you suggest?
    2) Can I use cubes and reports without modifying the existing OLTP DB structure to fact and Dimension? 
    Thanks
    Naveen

    hi,
    I have a requirement where I have to use existing database(OLTP) as my source to the SSAS cubes and then to build the reports.
    Where for Cubes and Reports I uses SQL Server BI edition. But my existing source data will be in non BI database.
    My questions are
    1) Can I create Fact and Dimension Model in Non BI Db and connect the same to SSAS and SSRS? What you suggest?
    2) Can I use cubes and reports without modifying the existing OLTP DB structure to fact and Dimension? 
    Thanks
    Naveen
    1. Yes. you can
    It doesnt necessary need to set up a OLAP system. However making design inline with OLAP would be easier to implement in SSAS
    2. Again yes
    But using OLTP designed tables in SSAS/SSRS would require some additional overheads at querying level like referenced lookups in SSAS vs lots of joins in backend queries in SSRS.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Sorting measures (calculated members) in SSAS cube designer

    Hi,
    In SSAS 2012 cube designer, on the "Calculations" tab I am writing some simple calculated members and displaying it in a folder (Display Folder=)
    FolderA
    am So this FolderA has the members as below :
    [<-A1], [-A1], [A],
    [A1], [A2], [A3], [A4], [A5],
    and [>A5] 
    While I am browsing the cube from Excel 2007, this FolderA is deployed correctly along with the above measures. All fine till here.
    However, while I expand FolderA, Sorting is not done correctly. It is displaying like below :
    <-A1, >A5, A, A1, -A1, A2, A3, A4, A5
    But I want it to be sorted correctly so that it looks good as below :
    <-A1, -A1, A, A1, A2, A3, A4, A5, >A5
    How to do this at cube level ? Any property or any work around (using the latest SSAS 2012 version)
    Thanks

     
    Hi Yvanlathem,
    I am not talking about sorting of folders/subfolders.
    I want to short calculated members within the folder
    As my first post itself says, For ex., 
    in FolderA
    this FolderA has the members as below :
    [<-A1], [-A1], [A], [A1], [A2], [A3], [A4], [A5], and [>A5] 
    However, while I browse cube and expand FolderA ;  Sorting is not done correctly. Currently it is displaying like below :
    <-A1, >A5, A, A1, -A1, A2,
    A3, A4, A5
    But I want it to be sorted correctly as below (After
    use of this solve order keyword it should sort as per below):
    <-A1, -A1, A,
    A1, A2, A3, A4, A5, >A5

  • SSRS Date parameter - current month from SSAS cube

    I have a SSAS cube with a date dimension called Posting Period and now I would like to have my report parameter using this date dimension to show the current month.
    So far I have worked out the following expression which are working(Fiscal year calendar going from May to May) for the year component - but I can't figure out how to get it to work on Quarter date part (and the month) so as you can see
    the Quarter and month is hardcoded in the below expression:
    ="[PostingPeriod].[Posting Period].[Year].&[" + CStr(Year(Today())-1) + "].&[Q4].&[10]”
    Any help would be appriciated.
    Tx

    Hi HCMJ,
    In your scenario, you use the expression
    ="[PostingPeriod].[Posting Period].[Year].&[" + CStr(Year(Today())-1) + "].&[Q4].&[10]”
    to set the default value of the parameter and then use it in the MDX query, right?
    If in this case, you can use the expression below
    ="[PostingPeriod].[Posting Period].[Year].&[2013].&[Q" & DatePart(DateInterval.Quarter,today()) & "].&[10]”
    to set the value on Quarter date part.
    And it returns:
    If I have anything misunderstood, please point it out and elaborate the meaning of "but I can't figure out how to get it to work on Quarter date part (and the month) so as you can see the Quarter and month is hardcoded
    ", so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • SSRS Expression Current month in a Fiscal calendar dimension from a SSAS cube

    How to create an expression for a default SSRS parameter to a SSAS cube when using i Fiscal Year calendar - and where I want to show current Calendar month and year (for example February 2014) 
    This is an example of my Time dimension for February 2014:
    [Time].[FiscalYMD].[Fiscal_Year].&[2013].&[10]
    The fiscal calendar goes from May - May - which means that April 2014
    would look like this:
    [Time].[FiscalYMD].[Fiscal_Year].&[2013].&[12]
    and May 2014 would look like this:
    [Time].[FiscalYMD].[Fiscal_Year].&[2014].&[01]
    Please advise

    Hi HCMJ,
    To represent the fiscal calendar, you shift the current date by 4 months back. Then you can do:
    ="[Time].[FiscalYMD].[Fiscal_Year].&[" & Year( DateAdd( "m", -4, Today() ) ) & "].&[" & Month( DateAdd( "m", -4, Today() ) ) & "]"
    It just gets the year and month of '4 months ago'. I have not tested it, but I guess it should work.
    Regards
    Andrew Borg Cardona

  • Navigational Attribute data is not display in Cube level and reporting

    Hello ALL
    Iam facing a problem like,I created Navigational attribute and I selected that navigational attribute in cube level also but data is not display in cube level.
    What will be the problem?Pl help me out.
    regards
    balaji

    Hi Dinesh
    You mean base characteristic means loading data after creating Navigational attribute?Is it this way,(orelse can u tell me about this base characterstic)
    Yes after making that particular attribute as a navigational attribute I loaded data in master data tables.
    How to run Attribute change run?can u give me steps
    regards
    balaji

  • Dimension Security causing SSAS cube to slow down

    Hi,
    Experiencing problems with with the SSAS cube once its processed. Sometimes takes around 20 mins for the excel to load once you drag down any dimension.The cube has got no calc scripts/named sets etc.It has around 17 dimensions and one dimension(Employer)
    has got 46 attributes and another (member)17.Others are pretty small.The Employer dimension is used twice as role playing and the both employer/member have got dimension security applied to it.There are about 6 roles have been set up to restrict access to
    members in these dimensions.
    The SQL profiler shows multiple "Query Dimension" (mostly for Employer dimension)followed by a lot of "Calculate Non Empty Current"s  .Suspect that the delay is due to the dimension security expression evaluation.This only happens
    during first access of the cube within a role and it's relatively quick when I'm accessing via a role which doesn't have dimension security applied to it.Is there anyway to automatically trigger this process right after the cube has been processed so that
    it doesn't cause agony to the first user?

    You could build a cache warmer that connects with EffectiveUserName=YourDomain\user1 on the connection string and loop through each user. But what is your dimension security expression? Maybe we can speed it up.
    http://artisconsulting.com/Blogs/GregGalloway

  • SSRS Parameter Drop downs are greyed out after changes to SSAS cube

    Hi
    I am facing a weird problem. I have 3 SSRS reports that are based on an SSAS cube. Few days back I deployed some changes to cube and everything works ok on dev environment. When I deployed the same changes to production, SSRS reports don't work. I don’t
    get any error or anything when I click open the report but all the parameter boxes are greyed out. If I restore SSAS database from dev to production then SSRS reports work fine and I can select parameter drop downs. What could possibly wrong here. I have no
    idea to what to troubleshoot here.
    Thanks
    Nik

    Hi Nik,
    Are you using render the report from a report snapshot? In contrast with reports that run on demand, it is not possible to specify a different parameter value for a report snapshot when the report is open. So the parameter textbox is grayed out. If the users
    want to view the report with different parameter, we can select “Always run this report with the most recent data” option in “Processing Options properties” page.
    Besides, if the issue is not in this scenario, we can try to edit the report with Report Builder to check whether the report is ok. Such as delete the parameters, then recreate them to check again.
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Error in Update rules while defining CKF at cube level

    Hi,
    I am willing to create a Calculated Key figure at CUBE level using formula function
    <b>Unit Cube: Item Cube / Units</b>
    <b>Definitation</b>
    Item Cube - Total Cube for line
    Units   - Actual destination quantity in alternative unit
    <b>Units</b>
    The Unit for ‘Item Cube’ is Volume unit and
    The Unit for ‘Units’ is Alternative Unit of Measure for Stock keeping Unit
    When i tried to create CKF at Cube level in update rules using formula it is displaying me an error that no unit is available in source system for the CKF Unit Cube
    How can I proceed on this
    Thanks

    Hi
    Have you transferred the global settings from the context menu of source system where all the units from the source is replicated to BW system
    Regards
    N Ganesh

Maybe you are looking for