Quantcast
Channel: SQL Server Analysis Services forum
Viewing all 14337 articles
Browse latest View live

Ignoring measure groups when preparing cumulative report

$
0
0

I have my cube design as follows. 

Measure groups(M) are partitioned by Routines (R)
for R1 => M1, M2,M3 are processed. for R2 => M2, M3 only processed. Now when i see cummulative report of R1 and R2 , i should see measures only from M2 and M3 (which are common between R1 and R2.) but not M1.


How to get Distinct Count of Products across two dimensions

$
0
0

Hi,

I have two dimensions, Item and Presentations. I need to get distinct count of products for IMD_Id + Merc_Pres_Id. IMD_Id is the lowest member in Item and Merc_Pres_Id is lowest in Presentation. My MDX query is given below but when I apply filters to slice it, it does not work and does not give right count. It always gives the count for all.

/* Last Year Demand - Demand for 12 months back of selected months */

WithMember [Measures].[LYDemand] as

Sum(

Generate(

EXISTING[All Date].[Fiscal Month Name].[Fiscal Month Name].Members,

{parallelperiod([All Date].[Fiscal Month Name].[Fiscal Month Name], 12

,[All Date].[Fiscal Month Name].CurrentMember)}

)

,[Measures].[Proj Demand]

)

 

/* ********************************************************************************************* */

 

/* Last to last Year Demand - Demand for 24 back of selected months */

Member [Measures].[LLYDemand]as

Sum(

Generate(

EXISTING[All Date].[Fiscal Month Name].[Fiscal Month Name].Members,

{parallelperiod([All Date].[Fiscal Month Name].[Fiscal Month Name], 24

,[All Date].[Fiscal Month Name].CurrentMember)}

)

,[Measures].[Proj Demand]

)

 

/* ********************************************************************************************* */

/* Current Year Active Products */

Member [Measures].[CYCount]as

CASEWHEN

[Measures].[Proj Demand] > 0

THEN

DistinctCount(Existing(([All Items].[IMD Id].[IMD Id],[All Merchandise Presentations].[Merch Pres Key].[Merch Pres Key])))

ELSE

NULL

END

 

/* Last year Active Products */

Member [Measures].[LYCount]as

CASEWHEN

[Measures].[LYDemand] > 0

THEN

DistinctCount(([All Items].[IMD Id].[IMD Id],[All Merchandise Presentations].[Merch Pres Key].[Merch Pres Key], [All Items].[Style Name].CurrentMember, (StrToMember('[All Date].[Fiscal Month Name].&[201401]',CONSTRAINED).Lag(12) : StrToMember('[All Date].[Fiscal Month Name].&[201411]',CONSTRAINED).Lag(12))))

ELSE

NULL

END

 

/* Last to last Year Active Products */

Member [Measures].[LLYCount]as

CASEWHEN

[Measures].[LLYDemand] > 0

THEN

DistinctCount(([All Items].[IMD Id].[IMD Id],[All Merchandise Presentations].[Merch Pres Key].[Merch Pres Key], [All Items].[Style Name].CurrentMember, (StrToMember('[All Date].[Fiscal Month Name].&[201401]',CONSTRAINED).Lag(24) : StrToMember('[All Date].[Fiscal Month Name].&[201411]',CONSTRAINED).Lag(24))))

ELSE NULL END

 

SELECT

{

[Measures].[CYCount], [Measures].[LYCount], [Measures].[LLYCount],

[Measures].[Proj Demand],[Measures].[LYDemand],[Measures].[LLYDemand]

}

ONCOLUMNS,

NonEmpty([All Items].[Demand Center Name].[Demand Center Name], [All Items].[Style Name].[Style Name])ONROWS

FROM

(SELECT (StrToSet('[All Items].[Style].[ALL]'))ONCOLUMNS

FROM

(SELECT (StrToSet('[All Items].[Demand Center].[ALL]'))ONCOLUMNS

 FROM

(select (STRTOSET('[All Items].[Merch Group].&[MG-110]'))onColumns

FROM

(SELECT (StrToSet('[All Merchandise Presentations].[Merch Pres Chnl Dkey].&[MPC-1]'))ONCOLUMNS

  From

[FMI Forecasting]

))))

WHERE {strToMember('[All Date].[Fiscal Month Name].&[201401]',CONSTRAINED) : StrToMember('[All Date].[Fiscal Month Name].&[201411]',CONSTRAINED)}

Requirements are as follows:

1. Distinct Count should not include products where Proj Demand is 0, when I am using Filter function to remove products with 0 demand, query is really slow and execution time goes up from 35- 40 secs to 8-9 Minutes.

2. When we apply filter (parameters) Distinct Count should be in the context of filters( which are mentioned in the select statement like Style, Demand Center and Merch Group). Currently after applying filters count does not change.

Thanks for help.

Distinct count of dimension business key in fact table

$
0
0

In my cube I have a fact table which joins to a patient dimension.  The patient dimension is a type 2.  What I would like to do is get a distinct count of patients who have records in the fact table.   The business key in the patient dimension is the PrimaryMrn.  So a SQL query would look like this.

SELECT count(distinct PrimaryMrn)
FROM EncounterFact e
INNER JOIN PatientDim p
on e.PatientKey = p.PatientKey

Is it possible to do this via MDX?

Thanks for the help.

question regarding dimensions

$
0
0

Hello, 

There is cube in which there is a dimension called Dim1. They set hierarchies for this dimension. 

Now they created another dimension with a name dim2 but it is using the dim1.

when i use the cube.. the the hierarchies in dim2 work.. but when i use dim1 and try to get data.. it does not work. why is it..

Calculating amounts for "shared months" in selection

$
0
0

Hi all

I need your help for an approach to the following problem. Lets say that i have the following dataset

AccountMonth

ActivityMonth

Amount

201307

201301

2.500

201307

201304

600

201307

201305

900

201307

201306

4.000

201307

201307

500.000

201308

201305

500

201308

201307

400

201308

201306

300

201308

201308

400.000

201309

201307

300

201309

201302

500

201309

201309

100.000

201310

201305

400

201310

201309

50.000

201310

201310

200.000

In my cube i want the user to select the Accountmonth from one time dimension, but i want some logic to also apply for the ActivityMonth. For one measure if I for example select 201307 i'll get this amount

AccountMonth

ActivityMonth

Amount

201307

201301

2.500

201307

201304

600

201307

201305

900

201307

201306

4.000

201307

201307

500.000

This is easy - Accountmonth dimension is related to AccountMonth column in the fact table. Now i also need another measure, where the month selected needs to be meet for both accounting and activity month. This is also easy, as i can just reference both columns in the fact table. Result in this case is then only one row:

AccountMonth

ActivityMonth

Amount

201307

201307

500.000

Now the tricky part comes when I start to select more months, because the amount i need is where month combinations are shared, so if i for example choose 201307, 201308 and 201309 i don't just want

AccountMonth

ActivityMonth

Amount

201307

201307

500.000

201308

201308

400.000

201309

201309

100.000

I actually want the amount from which the months is in either accounting or activity, like this

AccountMonth

ActivityMonth

Amount

201307

201307

500.000

201308

201307

400

201308

201308

400.000

201309

201307

300

201309

201309

100.000

I know how to solve it either by having two time dimensions or using MDX, but user should only have to select from one time dimension. So far, solving it using Non-empty/existing in MDX is not performing fast enough. Feedback will be appreaciated if you have an idea of how to solve this.

Deploy Single Cube in SSAS

$
0
0

Hi All,

I have an SSAS database which has two cubes.I have made some modification in one of the Cube using BIDS and no i wanted to deploy only the single cube to my testing environment.

how can i achieve it.It would be great help if i can get some documents related to it

Thanks,

SSAS performance counters do not appear in Internet Explorer

$
0
0

I created a few SSAS memory related performance counters (eg MSAS 2008:Memory\Memory Limit Low KB, \MSAS 2008:Memory\Memory Limit High KB etc) to monitor memory and saved it as .html (as I have done previously).

When I open this .html file in IE 11, these performance counters do not get loaded.

My machine details are as follows

OS: Windows 8 (64 Bit)

SQL Server 2008R2 (64 Bit)

IE (i believe) is also 64 bit. For reference my IE 11's version is 11.0.9600.17126IS. 

Previously these used to work and now only the SSAS counters do not seem to load. 

Any help is appreciated.

Thanks

Gautham


Gautham KAMATH

SSAS tabular model will not deploy to remote server (urgent)

$
0
0

Hi all,

I'm having major issues trying to deploy my tabular model (works fine locally) and i can't for the life of me figure out what the problem is.  It deploys metadata but errors on everything else.  I've tried deleting/recreating deploy from SSDT gives me same error as trying to deploy with wizard... please help!  

OLE DB or ODBC error: A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.; 08001; Client unable to establish connection; 08001; Encryption not supported on the client.; 08001.

A connection could not be made to the data source with the DataSourceID of 'edb11d15-7e07-4199-a6f5-bc7892c988d5', Name of ''

The connection it's complaining about i can confirm i can connect FROM the server i've just deployed the model to!!!


If i try and right click on cube through ssms i get below error... 

TITLE: Microsoft SQL Server Management Studio
------------------------------

The type initializer for 'Microsoft.AnalysisServices.BackEnd.DAXServices' threw an exception. (Microsoft.AnalysisServices.BackEnd)

------------------------------
ADDITIONAL INFORMATION:

Unexpected internal error in the parser: -1056899072 (msmgdsrv)

------------------------------
BUTTONS:

OK
------------------------------



Pivot Table with olap cube connection in excel addin c#

$
0
0

Hi,

I need get data from an olap cube for show it in a pivot table. what code I should use to get it?.

MDX expression that shows selected period from start till end date

$
0
0

Hi all,

I have a report that has a week parameter. So allows you to chose multiple weeks for example 

2014 W1, W2  , W5 etc ..

In my report I want to show in the layout using an expression : "From 2014 W1 untill 2014 W5".

How do I manage this in an expression? For now I use 

=Join(Parameters!PAR_Year_Week.label, "-" & " ") but this just shows 2014 W1, 2014 W2, 2014 W3, ..

Thanks in advance!

TABULAR: Is there to setup a measure so it can also show "last quarter" "last year", transform it back in time?

$
0
0

In other tools there are ways to do date transformations where you can setup a date transformation column in your date dimension and have a column with the date's value (last week, last month, last quarter, last year) then various metrics/measures can calculate against that value.

Does Tabular support something similar?

Excel Cube Failed to refresh after upgrading from excel 2007 to 2010

$
0
0

Hello Team ,

i have a lot of reports in excel that connect to SSAS but after upgrading from win XP to Win 8 and excel 2007 to excel 2010

the excel files failed to refresh , and here are the error messages,


kmousa

How to get a total regardless of level in hierarchy in MDX

$
0
0

I have GL Account Hierarchy with levels: Category1, Catergory2, Category3, GLAccount

The Category2 and Category3 subtotals need to be analyzed against different Category1 totals.

I have code like this in a calculated measure in the cube in SSAS to try and accomplish this:

Case
    When IsEmpty
         (
            ( 
              [Measures].[[Measures].[Home Net Change],
              [Dim GL Account].[Category2 Code]
            )
         ) 

    Then Null

When [Dim GL Account].[Category3 Code].CurrentMember is [Dim GL Account].[Category3 Code].[Lease Op]
    Then (
             [Measures].[Home Net Change]  /  [Measures].[L.Op Revenue Total]
    )

 When [Dim GL Account].[Category1 Code].CurrentMember is  [Dim GL Account].[Category1 Code].[Revenue]
    Then (
             [Measures].[Home Net Change]  /  [Measures].[Gross Revenue]
     )

    Else ( 
             [Measures].[Home Net Change]  / [Measures].[Company Revenue Total]  
    )
End

And it works fine when I have all of the levels displayed in the Cube Browser. But if I remove the Category1 level from the display it seems the case statement doesn't evaluate correctly and the "else" calculation is the one displayed.

The denominators in each of the case calculations are also calculated measures - so the problem could be there. I am particularly having issues with second CASE condition, so here is the code in the [Gross Revenue] calculated measure:

( [Dim GL Account].[Account Categories].[Category1 Code].[Revenue]  ,[Measures].[Home Net Change]  )

Thanks in advance

September

Question on dates

$
0
0

Hi all.  I am in the process of building my first cube and would like some advice on how to incorporate information gathering and displaying the information in the cube.  This all revolves around dates.

I am in the process of summarising information on a day to day basis.  My first question is what would be the preferred method data gathering:

  1. Take a snapshot of all summarised data from OLTP and insert a date of capture into the fact table on a daily basis or
  2. insert data into fact table from the last date of capture

I would also like some advice on reporting this information.  I would like the user to have access to a date filter/range which gives the user a point in time display of information.  How would I go about doing this in SSAS (taking question 1 into account).

Thanks in advance.

Dimention Hierarchy to get the data.

$
0
0

Please share me table structure and how can I define hierarchy in SSAS Multidimensional Cube.

I want something like Year->Months->Week->date.

Thanks.


Alternatives to Dimension facts for row counts

$
0
0

Hi,

I currently have a data warehouse with 3 fact tables, they are all at an order line granularity.  I want to start looking to add some facts that perform a distinct count of related dimensions (like how many orders, how many customers, etc).

The method i have used is to create a measure group from the dimension in question (lets say customers) which allows me to use a count measure. 

While this approach works, i dont like the fact that there will be many measure groups presented in the user application.  What I would like to do is have 1 measure group that contains all the "counts" for the dimensions i want.

Is that possible?  If so, could somebody point me in the right direction?

Many thanks in advance,

Dominic

Mdx Help needed

$
0
0

Hi All

in one of my reauirement we need to create a measure  with fallowing condition

Application = S6A/S6D

Command = ULR

Origin Realm <> epc.mnc001.mcc206.3gppnetwork.org *

Destination Realm = epc.mnc001.mcc206.3gppnetwork.org

i have used like this

IIF([Measures].[SuccessRate] > 0 ,
([Measures].[SuccessRate],([D Application].[Application].&[S6a/S6d],[D Command].[Command].&[ULR],{Except([D Origin Realm].[Origin Realm],[D Origin Realm].[Origin Realm].&[epc.mnc001.mcc206.3gppnetwork.org])},[D Destination Realm].[Destination Realm].&[epc.mnc001.mcc206.3gppnetwork.org]))
,null)

it is giving error at

{Except([D Origin Realm].[Origin Realm],[D Origin Realm].[Origin Realm].&[epc.mnc001.mcc206.3gppnetwork.org])}

how to achieve the above condition and how to achieve that * part that means it conatina any string after that .

Origin Realm <> epc.mnc001.mcc206.3gppnetwork.org *


Surendra Thota

Calculate working time

$
0
0

Hello, 

I'm new to SSAS and i've a dumb question. 

So, i have a log table which has several sensor values over time. Also, i've a time table. 

I need to calculate the working time. How should I model it? It's a measure or a dimension?

Example: 

Sensors

SensorTimestampValue

s12014-06-19 10:00:00.000 123

s22014-06-19 10:00:00.000 456

s12014-06-19 10:00:01.000 126

s22014-06-19 10:00:01.000 888

I need to know what are the second which have values...

Tks, 

Deploying a cube to Analysis Server

$
0
0

Hello, I have trouble deploying my cube, AdventureWorksCube1, to the Analysis Server. Can you help.  This is the results it gives me:

Warning 1 Dimension [Dim Scenario] : Create hierarchies in non-parent child dimensions. 0 0
Warning 2 Dimension [Dim Date] : Create hierarchies in non-parent child dimensions. 0 0
Warning 3 Database [Michael Eigbadon] : The database has no Time dimension. Consider creating one. 0 0
Error 4 Internal error: The operation terminated unsuccessfully. 0 0
Error 5 The datasource, 'Adventure Works DW2012', contains an ImpersonationMode that is not supported for processing operations. 0 0
Error 6 Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of 'Adventure Works DW2012', Name of 'Adventure Works DW2012'. 0 0
Error 7 Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of 'Dim Date', Name of 'Dim Date' was being processed. 0 0
Error 8 Errors in the OLAP storage engine: An error occurred while the 'Calendar Year' attribute of the 'Dim Date' dimension from the 'Michael Eigbadon' database was being processed. 0 0
Error 9 Server: The current operation was cancelled because another operation in the transaction failed. 0 0

how to get avg for a measure which only count value>0

$
0
0

trying  to create a calculated measure which will only avg one particular measure when measure is>0, the issue I am getting is if I use the following:

with

member testasavg(([LoanDetail].[Cat Client Service Rep].children),iif([measures].[Mtr Conditions Count]=0,null,[measures].[Mtr Conditions Count]))


select

{measures.test,[measures].[Mtr Conditions Count]}on 0,[LoanDetail].[Cat Client Service Rep].memberson 1


from

[GMCCUBE]

I got the right average, but this value only show on the all level, all the rest get null. but if I switch the children to members, the result will be wrong cause it is adding the all member value as well, how can I filter out the all member when calculate but show the average for all the members

Thanks in advance

Viewing all 14337 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>