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

DAX - Year over Year Calculation

$
0
0

Hi All,

We have a requirement of calculating the Year over Year Calculation in DAX for No. of Sales. Below is the table that we are using:

Year

Quarter

Date

No. of Sales

 


If we browse the tabular model with Year/Quater then formula should calculate the value at quarter levels.

Formula Definition for Q1 = (Total of “No. of Sales” in current Year for Q1  / Total of “No. of Sales” in current Year for Q1) -1


Formula Definition for Q2 = (Total of “No. of Sales” in current Year for Q2  / Total of “No. of Sales” in current Year for Q2) -1


Formula Definition for Q3 = (Total of “No. of Sales” in current Year for Q3  / Total of “No. of Sales” in current Year for Q3) -1


Formula Definition for Q4 = (Total of “No. of Sales” in current Year for Q4  / Total of “No. of Sales” in current Year for Q4) -1

Can anybody helps us in building this formula in DAX which should be able to browse with any columns of the table.

Thanks,

Vishal Jharwade

 

 




DAX - Year to Date Calculation

$
0
0

Hi All,

We have a requirement of calculating the Year to Date Calculation in DAX for No. of Sales. Below is the table that we are using:

Year

Quarter

Date

No. of Sales

 If we browse the tabular model with Year/Quarter then formula should calculate the value at quarter levels.

Formula Definition for Q1 = (Total of “No. of Sales” in current Year upto Q1  / Total of “No. of Sales” in current Year upto Q1) -1

 

Formula Definition for Q2 = (Total of “No. of Sales” in current Year upto Q2  / Total of “No. of Sales” in current Year upto Q2) -1

 

Formula Definition for Q3 = (Total of “No. of Sales” in current Year upto Q3  / Total of “No. of Sales” in current Year upto Q3) -1

 

Formula Definition for Q4 = (Total of “No. of Sales” in current Year upto Q4  / Total of “No. of Sales” in current Year upto Q4) -1

Can anybody help us in building this formula in DAX which should be able to browse with any columns of the table.

Thanks,

Vishal Jharwade

SSAS loses connection to local workspace

$
0
0

I seem to be running into this quite regularly these days. I'm editing an SSAS tabular model, filtering data in the views in VS 2012 to verify that calculations are working, and I get this:

The result is that any work you've done since you last saved is lost, because you won't be able to save. It's really getting quite frustrating.

I did find a post online that went over how you could recover your work from your local workspace SSAS install by reverse engineering/scripting the cube out of it, but that's really not an option in my case since I'm using source control and can't dump my project history every time this happens (and it happens multiple times a day now).

Does anyone know of a workaround for this issue before I open a support incident? Thanks.

Edit: Seems that screenshots don't get persisted to the messages in MSDN forums anymore. Here's the text of what would have been in the screenshot:

"cannot complete the operation because there is no connection to the workspace database that contains the model currently being edited"

Specific steps to re-create. Filter any column in the tabular designer, and when you go to clear the filter if you hit clear before the list of available values populates in the box below, it'll lose connection to the workspace server, and everything will be lost. Any attempt to save will result in:

"Unable to save the file Model.bim. Reason: The file cannot be saved because it is marked as readonly"

Some posted elsewhere about getting past this issue by un-setting the Model.bim file as read-only, or unsetting the entire project directory and it's contents as read-only,  but that has not worked on any workstation I have ran into this problem with.

I suspect this is only one of several ways to cause the issue - I know about this one, I try and avoid it, and I still run into problems occasionally.

SSAS Tabular : OLE DB or ODBC error : The Microsoft Access database engine cannot open or write to the file. It is already opened exclusively by another user, or you need permission to view and write it's data.; 3051.

$
0
0
Hi all, i'm trying to import a spreadsheet into a tabular model and getting this stupid error even though the impersonation account i'm using is an admin account with full access to the file.  ANY IDEAS? I hate these stupid permission related issues!!! Thanks for your help. 

SSAS calculated Member

$
0
0

Hi,

I have a fact table of having 10 date_key columns related to the date dimension's date_key column. Then i created the calculated members to calculate the count of each date_key columns. for this, i have created dimension usage and all related to date_key dimension. And i have created a Date Hierarchy of having Year,Quarter, Month, week and Date.

Then, i created the calculated member to calculate the count of each date_key columns for the year, month with the help of Date Hierarchy. My calculated members are as shown below.

(LinkMember([d Date].[Date Hierarchy].CurrentMember,[First Inquiry Date].[Date Hierarchy]),[Measures].[First Inquiry Date])

whereas, first Inquiry Date is one my Date Column.

But when i match the data with the relational database, the count is not matched. I don no where i am wrong.

anyone, please..

Pradeep

SUM value by multiple conditions in SSAS

$
0
0

Hi All,

I have a condition like as below, but the SUM value not working in CASE STATEMENT. Anyone can help me...!

SUM(CASE [Calendar].[Calendar Date]
    WHEN [Calendar].[Calendar Date].[Year] = '2005' AND [Calendar].[Calendar Date].[Month] = 1
    THEN [Calendar].[Calendar Date].CURRENTMEMBER.CHILDREN
    END
, [Measures].[Work Day Flag])

Thanks in Advance...!

Baskaran








Summarizing KPIs from multiple cubes

$
0
0

Hi there,

This might be a noob question but here it goes. I have cube files with data for different entities. Then there is an Excel file for each of these cubes using it as its data source to display a number of KPIs which look like this:

Invoices with Discount20,2 %
Late Payments30,2 %

and so on.. The Excel files show the same X number of KPIs which can be directly compared. For example, I might want to compare an industry average on theLate Payments percentage. What would be the best way to do it?

Is this something like the Power View as suggested here?

Looking forward to your suggestions.

-Ammar


Pulling data from cube based on Time Zones

$
0
0

I apologize up front for the length of this post, but I am relatively new to SSAS and have been struggling recently with trying to pull data from a cube based on different times zones, so I wanted to include lots of detail in hopes that someone can help me get past what I believe is one last stubborn issue.

I think that I am almost there, but seem to have a problem with the actual data being returned from the cube.

I have created my cube based on this article

http://dbaspot.com/sqlserver-olap/393157-time-dimension-time-zones.html

Here is how I have things setup

I have a DimDateTime table that has a primary key as follows

DW_DateTimeKey                 bigint

Primary key data in the DimDateTime table is a combination of Year+Month+Day + '1' + Hour + Minute, for example

DW_DateTimeKey                

2014042211451

2014042211452

2014042211453

etc...

Next, I have a table called MetaTimeZones with the following structure

PK    TimeZoneId    varchar(255)

        Name            varchar(255)

        Display Name varchar(255)

       Active             bit

The active records in MetaTimeZones are shown below

TimeZoneId                        Name                                    Display Name                                              Active

Central Standard Time         Central Standard Time            (UTC-06:00) Central Time (US & Canada)      1

Eastern Standard Time         Eastern Standard Time           (UTC-05:00) Central Time (US & Canada)      1

UTC                                    Coordinated Universal Time    (UTC) Coordinated Universal Time                  1

Next, I have a table called FactSession with the following simplified structure

PK      DW_FactSessionKey      int

         StartDW_DateTimeKey   bigint

        TalkTime                        int

        WasIvrAbandon              tinyint

And a sample of the simplified FactSession data is shown below. Note that all data in the StartDW_DateTimeKey field is UTC based

Finally, to tie everything together, I have created a 'bridge' fact table called MetaNewTimeZoneAdjustments that has the following structure

PK      UTCDW_DateTimeKey    bigint

PK      TimeZoneId                   varchar(255)

          LocalDW_DateTimeKey   bigint

For testing purposes, I have only placed a few records into MetaNewTimeZoneAdjustments  as shown below

In SSAS I have the DataSource View relationships setup as follows

  • FactSession.StartDW_DateTimeKey      -> MetaNewTimeZoneAdjustments.UTCDW_DateTimeKey
  • MetaNewTimeZoneAdjustments.TimeZoneId      -> MetaTimeZones.TimeZoneId
  • MetaNewTimeZoneAdjustments.UTCDW_DateTimeKey      -> DimDateTime.DW_DateTimeKey
  • MetaNewTimeZoneAdjustments.LocalDW_DateTimeKey->      DimDateTime.DW_DateTimeKey

I created a cube called 'FactSession' based on the 'FactSession' table.

Next, I created an intermediate measure group called 'UTCToLocal'(with just the default row count measure) based on the 'MetaNewTimeZoneAdjustments' table as shown below

Next, I created a Dimension called 'Dim Date Time' based on the 'DimDateTime' table, and added 2 roles of the 'Dim Date Time' dimension to the cube, one named 'UTCTime' and the other named 'LocalTime' as shown below

Next I created a 'Meta Time Zones' dimension based on the 'MetaTimeZones' table. The key for the 'Meta Time Zones' dimension is 'TimeZoneId'. I removed the 'All' member by setting 'IsAgregatable' to false and made the default member 'UTC'. The 'Meta Time Zones' dimension was then added to the cube as shown below

Next, the 'Dimension Useage' relationships for the cube were setup as follows

LocalTime - UTCToLocal 

  • Relationship      Type: regular
  • Granularity      Attribute: DW Date Time Key
  • Dimension Table:      DimDateTime
  • Measure Group      Table: MetaNewTimeZoneAdjustments
  • Dimension      Column: DW_DateTimeKey
  • Measure Group      Column: LocalDW_DateTimeKey

UTCTime - UTCToLocal

  • Relationship      Type: regular
  • Granularity      Attribute: DW Date Time Key
  • Dimension Table:      DimDateTime
  • Measure Group      Table: MetaNewTimeZoneAdjustments
  • Dimension      Column: DW_DateTimeKey
  • Measure Group      Column: UTCDW_DateTimeKey

UTCTime - FactSession

  • Relationship      Type: regular
  • Granularity      Attribute: DW Date Time Key
  • Dimension Table:      DimDateTime
  • Measure Group      Table: FactSession
  • Dimension      Column: DW_DateTimeKey
  • Measure Group      Column: StartDW_DateTimeKey

LocalTime - FactSession 

  • Relationship      Type: many-to-many
  • Dimension Table:      DimDateTime
  • Intermediate      Measure Group: UTCToLocal

Finally I created a Dimension called ‘Meta New Time Zone Adjustments’ based on the ‘MetaNewTimeZoneAdjustments’ table and added it to the cube, the fields here probably need a little explanation…

  • DW Date Time Key      = DimDateTime.DW_DateTimeKey
  • Local DW Date Time      Key = MetaNewTimeZoneAdjustments.LocalDW_DateTimeKey
  • Time Zone Id =      MetaTimeZones.TimeZoneId
  • Time Zone Id 1 =      MetaNewTimeZoneAdjustments.TimeZoneId
  • UTC DW Date Time      Key = MetaNewTimeZoneAdjustments.UTCDW_DateTimeKey

After everything was setup I deployed\processed the cube and ran the following MDX

SELECT

{

  [Measures].[Talk Time],

  [Measures].[Was Ivr Abandon]

}ONCOLUMNS,

NONEMPTY

{(

  [Meta New Time Zone Adjustments].[Local DW Date Time Key].&[2014042211145] : [Meta New Time Zone Adjustments].[Local DW Date Time Key].&[2014042211957]

)}ONROWS

FROM Sessions

WHEREFilter([Meta New Time Zone Adjustments].[Time Zone Id 1].ALLMEMBERS, Instr([Meta New Time Zone Adjustments].[Time Zone Id 1].CurrentMember.Properties('Member_Caption'),'Central Standard Time' ) > 0)

The results are shown below

        Talk Time             Was Ivr Abandon

2014042211455     22932361             91977

2014042211457     22932361             91977

Changing the time zone from ‘Central Standard Time’ to ‘Eastern Standard Time’ gives the following results

SELECT

{

  [Measures].[Talk Time],

  [Measures].[Was Ivr Abandon]

}ONCOLUMNS,

NONEMPTY

{(

  [Meta New Time Zone Adjustments].[Local DW Date Time Key].&[2014042211145] : [Meta New Time Zone Adjustments].[Local DW Date Time Key].&[2014042211957]

)}ONROWS

FROM Sessions

WHEREFilter([Meta New Time Zone Adjustments].[Time Zone Id 1].ALLMEMBERS, Instr([Meta New Time Zone Adjustments].[Time Zone Id 1].CurrentMember.Properties('Member_Caption'),'Eastern Standard Time' ) > 0)

                           Talk Time               Was Ivr Abandon

2014042211555    22932361             91977

2014042211557    22932361             91977

And changing the time zone to ‘UTC’ gives the following results

SELECT

{

  [Measures].[Talk Time],

  [Measures].[Was Ivr Abandon]

}ONCOLUMNS,

NONEMPTY

{(

  [Meta New Time Zone Adjustments].[Local DW Date Time Key].&[2014042211145] : [Meta New Time Zone Adjustments].[Local DW Date Time Key].&[2014042211957]

)}ONROWS

FROM Sessions

WHEREFilter([Meta New Time Zone Adjustments].[Time Zone Id 1].ALLMEMBERS, Instr([Meta New Time Zone Adjustments].[Time Zone Id 1].CurrentMember.Properties('Member_Caption'),'UTC' ) > 0)

                                Talk Time               Was Ivr Abandon

2014042211955         22932361             91977

2014042211957         22932361             91977

So the adjusting of the Time Zone gives different times as I had hoped for, but there is one glaring problem.

The problem is that the values returned from the Fact Session table are not correct. ‘22932361’ is actually the sum of the ‘Talk Time’ column for all of the records in the ‘FasctSession’ table. Similarily ‘91977’ is the sum of the ‘WasIvrAbandon’ column for all of the records in the ‘FactSession’ table.

The correct results for ‘Central Stand Time’ should be

        Talk Time               Was Ivr Abandon

2014042211455     115223                  255

2014042211457     177343                  255

Can anyone please provide some insight into why I am getting summed data returned ?

Thanks for your time

Brian


Impersonate user in XMLA and or .NET store procedure stored in Server level Assembly

$
0
0

Dear People

Is it possible to have a assembly wthe several functions, Like create users, create user rights to user, Create Catalog and more..

and the impersonate some of the functions/procedures to run under a Server administrator account. This for the fact that i do not want all people to have Server administrator rights, but i want to build a store procedure where people can execute the most common task on server administation level under this store procedure.

Fo example in .net

[SafeToPrepare(true)]

private statis string createDatabaseScriptXMLA()

{

string CatalogXMLA = string.format("<Create xmlns=\"http:// and more and more\">" +

....

return CatalogXMLA ;

}

Is it possible to assign something in the XMLA string that this script or function can run under administrator rights, althoug the executer itself is not a administrator.

Thanks in advance,

Michael

SSAS 2005 Excel drillthrough Error: Infinite recursion detected

$
0
0

Hello together

I have a problem with different behaviour with excel 2010 started on the same workstation.

This is the environment:
- a workstation with Windows 7 Office 2010
- a Windows Server 2008 Servicepack 2 (Testserver) with SQL Server 2005 and SSAS 2005 both Version 9.00.5057
  last Windows Servicepack Installation was December-2014
- a Windows Server 2008 Servicepack 2 (Production Server) with SQL Server 2005 and SSAS 2005 both Version 9.00.5057
  last Windows Servicepack Installation was 25-February-2015
 
The same Excel Sheet on the workstation can connect with MSOLAP.3 in the Connectionstring on the SSAS Instance on the Test Server.
If i try to connect on the production Server i get the Error  "XML for Analysis parser: The restriction value provided by the consumer either does not match other restrictions or refers to an unknown object". I have to change the connection string to "MSOLAP.4" but then i get the error "Infinite recursion detected" when i double-click a cell-value where i can drillthrough.

I have different behaviours on the Test and Production environment. Both are Windows 2008 Server Servicepacks and SQL Server 2005 is Version 9.00.5057, the difference between Test and Production enviroment is, that the Production has the newer Microsoft Servicepacks installed.

On the microsoft site i found out that there is a fix (KB 2389533) that can be installed with a cumulative Update for the SQL Server 2005 Servicepack 4. Is that the solution or is there another package than can be installed on the production server to eliminate the problem?
For me it seems that the problem came in after the installation of the Microsoft Windows Servicepacks that were installed at 26-Feb-2015.

Thank you for your help

Best Regards
Paolo Taverna

Production/Consumption product cube

$
0
0

Hi All,

I'm new to SSAS and I'm trying to implement a cube, that annalyse the quantity produced of a product and the quantity of products consumed by this production. there is a way to link those consumed products to the products in question ? Any best practice suggestions please ?

Install SSAS unattented Install on Windows 2012 Core edition

$
0
0

Dear People who can help.

We are trying to offer SSAS as a Self Service solution in our company. this without giving the user SYSADMIN rights.

When we install this in a vmware environment or on a brick it does not start up SSAS. When we install it on a server with a gui it just work. Does any one know how to solve this problem in Windows 2012 Core edition without a gui?

Thanks in advance,

Michael


Does Position Of Cube Dimension Matter While Adding it as Measure

$
0
0

I've created a cube on the Adventure Works Database. And when tried to process the Cube i get error

Errors in the OLAP storage engine: The attribute key cannot be found when processing: Table: 'dbo_DimProduct', Column: 'ProductKey', Value: '1'. The attribute is 'Product Key'. Errors in the OLAP storage engine: The attribute key was converted to an unknown member because the attribute key was not found. Attribute Product Key of Dimension: Dim Product from Database: Analysis Services Project, Cube: Adventure Works DW, Measure Group: Dim Product, Partition: Dim Product, Record: 1. 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. Errors in the OLAP storage engine: An error occurred while processing the 'Dim Product' partition of the 'Dim Product' measure group for the 'Adventure Works DW' cube from the Analysis Services Project database.

This is faced When Dimproduct Dimension was added first and later Dimtime Dimension.

I delete Dim Product Database Dimension and have Added it again as both Measure and Cube Dimension and it process succesfully.

Only Difference i've Found is now Dimproduct is listed last in cube dimensions.Cube Dimension DimProduct added after delete,listed last in position

Question - Does position of Cube Dimension matters when adding its a Measure?

And what is causing this error?


HS

Combining two data sets for a report..

$
0
0

Hi,

I am new to the MDX queries and don't have much knowledge. Please help me how to combine the below two datasets into one,

Dataset1:

SELECT NON EMPTY { [Measures].[Pages Printed Since Last Service], [Measures].[Service Order Details SITE_VISITS], [Measures].[Actual Restore Minutes], [Measures].[Actual Response Minutes] } ON COLUMNS, NON EMPTY { ([Customers].[Customers].[Customers].ALLMEMBERS * [Date - Call In Date].[Calendar YQMD].[Date].ALLMEMBERS * [Service Machine Install Base].[Machine Place State].[Machine Place State].ALLMEMBERS * [Service Machine Install Base].[tblMachineInstallBase].[tblMachineInstallBase].ALLMEMBERS * [Service Order Details].[Service Order Number].[Service Order Number].ALLMEMBERS * [Service Order Details].[Status].[Status].ALLMEMBERS * [Service Fault Codes].[Fault Desc].[Fault Desc].ALLMEMBERS * [Service Machine Install Base].[Machine Place Name].[Machine Place Name].ALLMEMBERS * [Service Machine Install Base].[Machine Place Street].[Machine Place Street].ALLMEMBERS * [Service Machine Install Base].[Machine Place City].[Machine Place City].ALLMEMBERS * [Service Machine Install Base].[Machine Place Country].[Machine Place Country].ALLMEMBERS * [Service Machine Install Base].[Machine Place Zipcode].[Machine Place Zipcode].ALLMEMBERS * [Service Fault Codes].[Service Fault Codes].[Service Fault Codes].ALLMEMBERS * [Service Order Remedy Code].[Remedy Code Description].[Remedy Code Description].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( -{ [Service Machine Install Base].[Machine Place Name].[All].UNKNOWNMEMBER } ) ON COLUMNS FROM [Dynamics AX]) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

Dataset2:

SELECT NON EMPTY { [Measures].[Consumed Copy Usage] } ON COLUMNS, NON EMPTY { ([Service Machine Install Base].[tblMachineInstallBase].[tblMachineInstallBase].ALLMEMBERS * [Service Machine Install Base].[Serial No].[Serial No].ALLMEMBERS * [Service Machine Install Base].[Asset No].[Asset No].ALLMEMBERS * [Items].[Item].[Item].ALLMEMBERS * [Service Machine Install Base].[BUSINESS_PARTNER_FLAG].[BUSINESS_PARTNER_FLAG].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM [Dynamics AX] CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

Limitations on CustomData property of ConnectionString

$
0
0

Is there any place where I can find detailed documentation for the CustomDataproperty of ConnectionString for Analysis Services?

I've read MSDN Documentation for

  1. Connection String Properties (Analysis Services)
  2. AdomdConnection.ConnectionString Property

Both of the links do not mention anything at all about CustomData.

The information I need is:

  • What are the restrictions on CustomData parameter with respect to its length and datatype?
  • Can I pass a formatted string, that I can process later maybe through an assembly in cube, as a parameter inCustomData?

Regards,
Akshay


Sub Dimension Architecture

$
0
0

I'm working through an example where I have a list of products that share almost no attribute fields (similar to the kimball example for snowflaking Financial Product Dimensions).  I created a snowflake of Product Subdimensions: dimProduct1 (pk ProdID), dimProduct2 (pk ProdID), dimProduct3 (pk ProdID).  The keys are created using a bridge table, dimProductBase, so that ProdID is unique across all tables.

My Fact table, factProductMetrics, has a fk ProdID.

My 2 questions are:

1. Is it bad practice to skip the bridge table and link directly to the fact table?

2. I've read that this type of join can be resolved using a "relational view" but I'm not exactly sure how to do this in T-SQL?

Thank you

Problem while refreshing the cube from excel

$
0
0
I am trying to refresh the excel file(Cube from excel). 
But i can able to refresh the same cube in server. But users facing this problem.
The following error coming 

I was working fine till yesterday. 

Please suggest me... 

Sudhan

Parameterized measure type - 2 different approaches

$
0
0

Hi colleagues,

I need again your priceless time to discuss the following situation:

I would like to parametetized the type of measure, or better, the type o calculation applied to a specific measure, i.e., I have only two base measure, Net Sales, and Gross Sales, and then I have different calculations like YTD, Currency Adjusted, Currency Adjusted Last Year, EUR Value, EUR Value LY, etc...

Instead of create a big set of calculated members, I would like to create a measure type dimension instead, and then the user can select want he wants to see. I figured out two different ways:

1) In the view which feeds the cube, create a data set for every measure type and flag it with the correspondent type and then apply an Union All to join the sets. The big disadvantage for me is, I will multiply the size of this measure group by the number of different measure types that I have.

2) Inside the calculated member formula, use a switch of if-else statement to determine which formula should be apply. My concerns here are related to the performance of this approach.

Any Idea or comment would be highly appreciated.

Kind Regards,

How to Create Previous Month MDX measures

$
0
0
I have Date dimension with following hierarchy 
Year>Quarters>Month>Date
I have measure IDCOUNT in a fact table on daily basis.
Now I want to create following MDX measures. 

Previous Month IDCount 
Previous Month IDCount-1  -- means 1 month from previous Lag(1) on monthly basis
 
If a user select month [Jan 2015] then MDX measures should be 

Previous Month IDCount    -- [Feb 2015]
Previous Month IDCount-1  -- [Dec 2014] 

Grand total value is not coming correctly

$
0
0
I have 2 Measures in my cube.Second measure is based on first measure only.
In row level i have selected one Dimenson.
Then 2nd Measure values are coming fine excetpt GrandTotal value.

Please suggest me, how to correct it to get proper GrandTotal value.

Sudhan

Viewing all 14337 articles
Browse latest View live


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