Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all 2472 articles
Browse latest View live

Row number to MDX query

$
0
0

Hey how do i add a row number to my MDX query i like it to return the row number for the number of rows returned.

Eample

Row_no

1

2

3

 SELECT
 NON EMPTY { [Measures].[Sales_val], [Measures].[Cost_val], [Measures].[Profit_val] }
 ON COLUMNS,
 NON EMPTY
 { ([Date].[Week].[Week].ALLMEMBERS * [Date].[Date].[Date].ALLMEMBERS * [Date].[Day Of Week].[Day Of Week].ALLMEMBERS * [Dept].[code].[code].ALLMEMBERS ) }
 DIMENSION PROPERTIES MEMBER_CAPTION,
 MEMBER_UNIQUE_NAME ON ROWS
 FROM
 ( SELECT ( { [Date].[Previous Date Flag].&[Y] } )
 ON COLUMNS
 FROM [Dev Cube])
 WHERE ( [Date].[Previous Date Flag].&[Y] )
 CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR,
 FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS


MDX calculation versus new Dimension attribute

$
0
0

Hi,

I have implemented a Product dimension sharing a lot of characteristics with the Adventure Works 2008 R2 sample and is a slowly changing dimension.

One problem that I can't seem to get my head around, is when I am querying the cube via MDX, how would I go about aggregating against the Product code directly?  The following should highlight what I mean:

select

NON EMPTY {[Measures].[Sales Amount],[Measures].[Internet Sales Amount], [Measures].[Internet Tax Amount]}on columns,

NON EMPTY { {[Product].[Product].&[223],[Product].[Product].&[224], [Product].[Product].&[225]}}on rows
from
[Adventure Works]

The rows are the 'AWC Logo Cap' Product.  What I dont understant is how to reduce this into 1 row and aggregate all the numbers together e.g. group by Product. e.g. the Sales Amount would be 51k for all time.

Can I tweak the definition of my Product dimension for this? Can i do this in a calculated member, or both?

It seems reasonable for my particular end users to ask questions such as "what is the sum of commission for Product code 'X' ?"

Am hoping that I missed something obvious.

Thanks in advance.

MrPeds


Database and Application Developer

Prevent SSAS Cube Project Download

$
0
0

Hello.

We developed a cube and would like to restrict our end users from being able to connect to the cube using BIDS and see the code, steps, etc that we used when creating the cube. At the same time, we want to make sure that they can browse the cube using Excel or a SQL MS interface.

Is this possible?

Thank you.

AV


AV

SSAS Dimension Sorting While Browsing In Excel

$
0
0

Hello,

I would like to use a defined sorting for dimension name. For example If I have Dimensions by name A,B,C than I would like to see these dimensions while browsing cube in the order of B,C,A.

Just to mention I am looking for Dimension sorting while browsing, Not Dimension attributes sorting.

Is there a way we can achieve this?

Regards,

Palash

Error on Calculated member

$
0
0

All,

I'm in the process of learning MDX, OLAP ... etc. I tried running this code via SSMS and encountered an error for the Calculated Member - [Warehouse Margin]. Though it is not returning an error on the messages tab, in the results tab the cell has #Error instead of a value. The Cube is based on the [FoodMart 2005] database.

The SSAS version is 11.0.2100

Thanks,

rgn

WITH
   MEMBER [Measures].[Warehouse Margin] AS
   ([Time].CurrentMember , [Measures].[Store Sales])-([Time].Currentmember, [Measures].[Store Cost])
SELECT
   {[Measures].[Store Sales],[Measures].[Store Cost],[Measures].[Warehouse Margin]}
        ON COLUMNS,
   {([Store].[Store Country].[USA])} ON ROWS
FROM Budget
WHERE ([Time].[1998])

OLE DB error: OLE DB or ODBC error: Login failed for user '\SQLSERVICE'.; 28000.

$
0
0

Hi,

I'm trying to process the dimensions and cubes and i'm getting the following error:

OLE DB error: OLE DB or ODBC error: Login failed for user '\SQLSERVICE'.; 28000.

I clicked on the data source and tested the connection and it was a success.

From my pc i remoted onto the dev server and created the cubes and dimensions , i'm using sql server 2008r2.When creating the cubes i used the default SERVICE ACCOUNT.Please let me know where i'm going wrong.

Thanks

Incremental Processing and Partition & Fact table Design

$
0
0

I'm setting up the following to handle our very large daily data loads into a dimensional database and would appreciate any advice or comments if I'm doing something that could cause me problems, or an improvement could be made.

In the RdB on the same server as we have our dimensional dB, I have factTable_currentDate with only the current days' data (approx. 14M records). The remaining data is kept on a separate server, partitioned by month. However I'm hoping I will rarely, if ever, need to access them when updating the cube.

In the SSIS package I will:

1. Truncate then import the current days' data in the rDb factTable_currentDate

2. Process Update the changing dimensions

3. Process Incremental the current days' fact table

Because each days' data is standalone i.e. there are no updates/deletes/additions to prior days' data, I'm thinking this will not cause me any issues. Same with the dim tables - any new attributes will only affect fact data going forward.

WIll this work as I'm hoping and let me do miminal processing to keep the cube updated?

calculated measures shows diemension members even for no measure values within the calculated measure

$
0
0

i am using calculated measures, when the dimesnion members show even if there are no valuess for the measure i cannot use the non empty behavior propert because that proved dangerous as it elimated some measure values under ceratin circumstances, can anyone please suggest a way so as to be able to limit the members in the dimension to show only the ones that have a value for the calculated measure.

thanks much


Named calculation on a fact table

$
0
0

Hello,

I have a measure, MyMeasure, whose measure group is linked to two dimensions: Date and DateType. These correspond to a fact table called FactMyMeasure and two dimension tables DimDate and DimDateType in my Data Source view.The fact table, FactMyMeasure, has 3 columns:

Date Key
DateType Key
MyMeasure

One of these, however, is not a regular column; [DateType Key] is actually a named calculation whose code looks like this:

        (
            SELECT dates.[DateType Key]
            FROM [Cube].[DimDate] AS dates
            WHERE dates.[Date Key] = [Cube].[FactMyMeasure].[Date Key]
        )

This gives the impression that MyMeasure depends on two dimensions, when in reality DateType is a dummy that's generated through the value of Date.

I have a problem when trying to process the cube on a populated Data Source:
The multi-part identifier "Cube.FactMyMeasure.Date Key" could not be bound.

I believe this is because the data used to populate FactMyMeasure comes from multiple different Views, each corresponding to a different partition. Therefore, [Cube].[FactMyMeasure].[Date Key] appears to not exist as the name of the table changes from one View to the other.

Any clues on how I could work around this problem?

Security cache and default member

$
0
0

Hi, 

Could you help me a bit?

I'm trying to implement dynamic security in a cube. It looks working but sometimes shows wrong results.

After processing employee A may see result set of employee B. But it is not a rule, incorrect behaviour is about 10% of all test cases.

At the same time dedicated TestUser does not experiencing this issue if it belongs to any other role than others or has admin rights.

There are two SSAS servers - one is processing server, second is a query server. Afert cube is processed on Processing server database is synchronized with Query server. Both backup/restore and native database synchronization methods has the same results.

I've investigated that last session on query server before synchronization is finished belongs to employee B.

XMLA Clear Cache command does not solve the issue. There is only way to manage this - synchronize database again, maybe twice. 

All employees are members of an only Role (except of dedicated test user, mentioned above). Cube has [Viewer] dimension. For each SSAS cube user this dimension has exactly one corresponding member.

Default member of an only non aggregatable hierarhy [Viewer].[Employee] is set to current authenticated user via custom .NET assembly. Default Member expression uses USERNAME() function to determine which member should be used as default. It looks like this:

App.MSAS.Extensions.GetViewerByLogin(USERNAME)

All secured measures related to [Viewer] dimension by cascaded m2m relation.

Each secured dimension has allowed set expression like this: NONEMPTY([Secured Dimension].[Granularity Attribute].MEMBERS,  [Measures].[Securable Object Count]). Visual totals are applied.

[Securable Object Count] measure is related with [Viewer] by m2m and with [Secured Dimension] using regular relationship.

Is it cache related issue? Should SSAS share cached execution results between employees? Slice by [Viewer] is not specified obviously, but it specified as default member expression.

P.S.  I has rewrite allowed member set specifying the [Viewer].[Employee] obviously:

NONEMPTY(

[Secured Dimension].[Granularity Attribute].MEMBERS,  

([Measures].[Securable Object Count],App.MSAS.Extensions.GetViewerByLogin(USERNAME))

)

GetViewerByLogin procedure is a place to override default member for some employees (for test reasons, or to delegate rights to vice). It uses relational SQL database to handle this, and called multiple times. So fixing (I'm not sure if is it fixed now) bug by this way leads to slower cube initialization. Performance is critical.

Thank you!






SSAS Between Dates

$
0
0

I am trying to create a solution that has a count of Retailers.

My Retailers Dimention has a Beginning Date and close date in it.

in the fact/measures I want to display a count of retailers that were open between the open and close dates.  In my DSV, i have the relationships established between my time table and the beginning and end dates

But when i display the results of sales for 2008, i have retailers of 30,000 - this is correct because this count is coming from my fact table.

The total number of possibilities is only 60000 - this is coming from the beginning date of the dimension table.  This is wrong.  in 2008 i need to evaluate everying that was open prior to 2008 and closed after 2008 which is about 800,000.

Hos do you get SSAS to evaluate the open accounts when the sale was between the open and close date?


KDW

Calculated members with a currency data type don't display correctly in Excel.

$
0
0

Hi there,

I'm using SQL Server Analysis Services 2008 and am having trouble getting calculated members which have the FORMAT_STRING="Currency" to display correctly in Excel 2010.

Using the cube browser in BIDS my currency calculated members are displaying correctly, however in Excel 2010 they are just being represented in the format "#,00".

So the measure value in the cube browser looks like $16,361.13 however in Excel it looks like 16361.132.  Now I could easily within Excel change the format of the value to display as currency however it should do that automatically.

The strange thing is that my non-calculated members, i.e. the generic measures which should be displayed as currency do display in Excel correctly automatically.  For some reason it's just my currency calculated members which don't.  This is the same across all of my cubes and I'm not sure why.

Would anyone be able to offer some insight please?

Kind regards,

Chris

Member properties in excel is (blank) but dimension attribute

$
0
0

Hello,

I have a question regarding SSAS and member properties in excel. In the attached screenshot, when I hovered my mouse over ID 1067355, I saw all member properties associated with the ID. However, the "Description: " property was (blank). My question is: How can I display value from the Description property field and not (blank)? In SSAS, I am certain that the Description field was populated with data (column C). But for some apparent reasons when I am trying to display Description as a member property, it was (blank). Any assistance is greatly appreciated! Thanks!

SSAS Custom Aggregation based on Dimension

$
0
0

Hi,

I have a problem that I think is quite simple, I just think I lack the MDX awesomeness to be able to solve it myself.

Essentially I have a CUBE for which I want to design a custom aggregation on the "Score" Metric, this metric will aggregate using the Last Non-Empty function along the Time dimension, but the Sum aggregation function across all other dimensions.

So for example assume I have a table that looks like this:

Date Client Metric Name Score
01/01/2012 Client 1 Facebook Likes 10
01/01/2012 Client 1 YouTube Likes 3
02/01/2012 Client 1 Facebook Likes 8
03/01/2012 Client 1 Facebook Likes 6
04/01/2012 Client 1 Facebook Likes 12
05/01/2012 Client 1 Facebook Likes 2
01/01/2012 Client 2 Facebook Likes 0
02/01/2012 Client 2 Facebook Likes 4
03/01/2012 Client 2 Facebook Likes 10

The table will aggregate along the time dimension as follows (Last Non-Empty):

Month Client Metric Name Score
Jan-12 Client 1 Facebook Likes 2
Jan-12 Client 1 YouTube Likes 3
Jan-12 Client 2 Facebook Likes 10

But along the Metric dimension as follows (SUM):

Month Client Score
Jan-12 Client 1 5
Jan-12 Client 2 10

And along the Client dimension in the same way (SUM)

Month Metric Name Score
Jan-12 Facebook Likes 12
Jan-12 YouTube Likes 3

How would I be able to achieve this behaviour in SSAS?.

Thanks!

/>L

Either the user does not have access to the database, or the database does not exist

$
0
0

Hi All

Actually i have issue regarding browsing cube in browser . when i cick on Brower tab for bwosing i found this error 

"Either the user does not have access to the database, or the database does not exist"

i followed this step but getting same error again.

Open SQL Server Management Studio. In the Connect to Server window, connect to the instance of SQL Server 2005 Analysis Services that i used

  1. In Microsoft SQL Server Management Studio, in Object Explorer, right-click your SQL Server 2005 Analysis Services instance name, and then click Properties.

  2. On the Analysis Services Properties page, in the Select a page pane, click Security. NT Users and Groups that are members of the server role will appear in a list.

  3. Click Add. In the Select Users or Groups page, go to the Enter the object names to select field and enter the name of the group you are adding to the server role. Click Check Name to verify that the account exists.

  4. Click OK.

Kindly Help


The measure group has zero dimensional with all other measure group. consider moving to separate cube

$
0
0

getting warning The measure group has zero dimensional with all other measure group. consider moving to separate cube

for reporting purpose, i can n't have two separate cube,  because of warning,    one measure group total not sliced with dimension, total amount is displayed to all dimension.

thanks

v

Set default member for data dimension

$
0
0

Hi

I have 8 cubes and 15 Dimension In which Date dimension is common and shared for all Cubes. Now i want to set DefaultMember for Date in Date Dimension to Yestarday date for only one cube not for rest all cubes.

can i set defaultmember= Yestarday date in Date properties or is there any other way where i can set default member of date to yestarday date and it should effect to selected cube .

please advice any ways to implement this.

Is there any way to use the ExcelMDX assembly in SSAS running in Tabular Mode? Would there be any way to access ExcelMDX functions from DAX?

$
0
0

I'm trying to create an XIRR measure using DAX/Tabular mode...

SSAS Large Data Sets

$
0
0

I am trying to build a cube with Large DS in the fact table.  The Sales table for 24 month has 200 Million Records.

Here was my approach -

I built a cube successfully with a query in the dataset considing of only the last 10 days and 1 partition.  The DS is an Oracle source and in the where clause, I am using "Where InvoiceDate <= sysdate-10"  (If anyone has a better way, please let me know - I have tried, "12-Jun-01", "2012-06-01" and these have not been succesful)

So, after the cube build was successful, I went back and built a 24 month history by removing the condition in the where clause of the ds query.  Then I went to create partitions of my fact table (approx 8 of them) using queries of the fact table - then in the query syntax of the partition construct I would plave in the where clause, "Where InvoiceDate between (sysdate-730) and (sysdate-611)"  - I repeated this process many times to fill out approx quarterly partitions.

When I go to process the dimension again,  and it Fails. 

Errors and Warnings from Response
 Internal error: The operation terminated unsuccessfully.
 File system error: A FileStore error from WriteFile occurred. Physical file: \\?\R:\DAT1\OLAP\713_Test.0.db\P SALE ITEM.16.dim\30.SLS ID.asstore. Logical file: . .
 Errors in the OLAP storage engine: An error occurred while the 'ID' attribute of the 'SALEITEM' dimension from the '713_Test' database was being processed.
 Errors in the OLAP storage engine: The process operation ended because the number of errors encountered during processing reached the defined limit of allowable errors for the operation.
 Server: The operation has been cancelled.


KDW


MDX Distinct count for the date range.

$
0
0

I am trying to find the number of customers who has shipped for the date range using the below mentioned query But I got the result as #error . 

Please help me to solve this issue.

Thank you,

Subin


Viewing all 2472 articles
Browse latest View live


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