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

SSAS Full Process - Disk Space - Multiple KSSTORE Files - Can I delete??

$
0
0

SSAS Gurus,

I'm just trying to perform a FULL PROCESS of our Cube and having a fair bit of trouble.  The main one is that I'm running out of disk space and my FULL PROCESS Job fails.

SSMS reports my cube size at 165GB.

However, when I check the size of all the combined files on the folder where my Cube resides, Explorer reports just over 460GB.

After a closer look, I have found that I have a number of duplicated files as per the following.  The dates 1.7.2018 and 17.11.2018 were probably the dates at which the a FULL PROCESS job has failed.

\\...\OLAP\MyCube\MyDim\590.Accounting Period.ksstore       4,490,395,726  1/07/2018 21:52:34
\\...\OLAP\MyCube\MyDim\591.Accounting Period.ksstore       4,490,395,726  17/11/2018 09:46:05
\\...\OLAP\MyCube\MyDim\592.Accounting Period.ksstore       4,490,395,726  18/11/2018 10:14:46

\\...\OLAP\MyCube\MyDim\590.Term Number.ksstore             4,490,788,942  1/07/2018 22:13:21
\\...\OLAP\MyCube\MyDim\591.Term Number.ksstore             4,490,788,942  17/11/2018 10:02:07
\\...\OLAP\MyCube\MyDim\592.Term Number.ksstore             4,490,788,942  18/11/2018 10:27:55

\\...\OLAP\MyCube\MyDim\590.Term Number.kstore              1,332,980,037  1/07/2018 22:13:23
\\...\OLAP\MyCube\MyDim\591.Term Number.kstore              1,332,980,037  17/11/2018 10:02:09
\\...\OLAP\MyCube\MyDim\592.Term Number.kstore              1,332,980,037  18/11/2018 10:27:58

So my question(s) are ...

  • Why are there multiple copies of these files on my filesystem?
  • I'm assuming that NOT all copies are required ... YES ??
  • What does the 590/591/592 prefix mean?
  • Can I just delete them?  (Not letting me at the moment as I have another FULL PROCESS happening which looks like it is locking the files)
  • What is the cleanest way to get rid of these files.
  • Is there another process I need to run BEFORE a FULL PROCESS that would make this cleaner?

Sorry, just don't know enough about SSAS at this level to make a call myself.

Any help much appreciated.

Regards

Basil


TotalYTD for dynamic fiscal years

$
0
0

Hi,

i have a scenario wherein i need to change the report based on the fiscal year of a customer. 

Customers keep purchasing from me over the year. I need to show the customers their report and need to indicate the report based on their fiscal years. e.g. Fiscal year for customer A may be Jul to Jun and for customer B may be Apr to Mar and for customer C may have Sep to Aug. In cases where the customer has not defined his fiscal year, it is assumed to be Jan to Dec. Hence the fiscal year start and end is created as a measure.

When i use the TotalYTD function, i have to send as hardcoded 4th parameter viz. either "30/6" or "31/03" or "31/08" and so on.

I am not able to pass a measure as the 4th parameter to the TotalYTD function

e.g. YTDSales = TOTALYTD(

    [SalesAmount],
    'Date'[Date],

    CustomerFiscalEnd)

Is there any workaround for the same?

Please help.

Rgds,

Rajeev

dax 5 year totals for each period selected

$
0
0

Hi,

i have the following table and i'm trying to calculate the 3rd column (last 5 year total) based on the first 2 columns:

So for 2018, i need to get the total count of losses for the last 5 years (including 2018).  so that would be 2013 thru 2018.  2017 would be 2012 thru 2017 and so on....

if there are not 5 years to go back in the data, it would just use 0 for the missing years.  So for 2013 above, since the data set starts at 2011 it would use just 2011 thru 2013.

I know that i need to use calculate and then some type of Max(Year), but i can't seem to get anything to work correctly.

MDX Query Help - Translating T-SQL to MDX

$
0
0

I'm hoping someone can help me with this query that I have struggled with for a few hours (new MDX user). 

I can easily get what I need using T-SQL but getting the equivalent using MDX has proven difficult.

use [AdventureWorksDW2012]

------------------------------------------------------------
--Select customers that purchased specific items during specific time period
------------------------------------------------------------ 
drop table #Customers_Purchased_SelectedProduct
select
distinct 
	a.CustomerKey
into #Customers_Purchased_SelectedProduct
from [dbo].[FactInternetSales] a
	inner join [dbo].[DimProduct] b on a.ProductKey = b.ProductKey
	inner join [dbo].[DimProductSubcategory] c on b.ProductSubcategoryKey = c.ProductSubcategoryKey
where
	 a.ShipDateKey between 20050101 and 20081215
	and c.ProductSubcategoryKey in (1 , 2)

------------------------------------------------------------
--Get sales metrics for customers identified above
------------------------------------------------------------ 
select
	c.ProductSubcategoryKey
	, b.ProductKey
	, sum(a.SalesAmount) as SalesAmount
	, count(distinct a.CustomerKey) as 'CustomerDistinct_withPurchases'
from [dbo].[FactInternetSales] a
	inner join [dbo].[DimProduct] b on a.ProductKey = b.ProductKey
	inner join [dbo].[DimProductSubcategory] c on b.ProductSubcategoryKey = c.ProductSubcategoryKey
	inner join #Customers_Purchased_SelectedProduct bb on a.CustomerKey = bb.CustomerKey
where
	a.ShipDateKey between 20050101 and 20081215
	and c.ProductSubcategoryKey not in (1 , 2)
group by 
	c.ProductSubcategoryKey
	, b.ProductKey

The code below is what I came up with.  Seems extremely clunky and after 2 minutes it returns data and isn't correct.

with

------------------------------------------------------------
----Select customers that purchased specific items during specific time period
------------------------------------------------------------ 
set [Cust] as
nonempty(
			[Dim Customer].[Customer Key].[Customer Key].members ,
			(
				({[Dim Product].[Product Subcategory Key].&[1] ,[Dim Product].[Product Subcategory Key].&[2]}) ,
				({[Ship Date].[Date Key].&[20050101]: [Ship Date].[Date Key].&[20081215]}) ,
				[Measures].[Sales Amount]
			)
		)

------------------------------------------------------------
--Create list of subcategories excluding the ones from above
------------------------------------------------------------ 

set [SubCategory Other] as
	except (
				[Dim Product].[Product Subcategory Key].[Product Subcategory Key]
			, ({[Dim Product].[Product Subcategory Key].&[1] ,[Dim Product].[Product Subcategory Key].&[2]})
			)

member [Sales Amount Selected Customers] as sum([Cust] , [Measures].[Sales Amount])
member [Customer Count] as count(nonempty([Cust],[Sales Amount Selected Customers]))

select 
{[Sales Amount Selected Customers] , [Customer Count]} on 0
, ([SubCategory Other] * [Dim Product].[Product Key].[Product Key]) on 1
 from [Adventure Works DW2012]

Incorrect results set:

enter image description here

Your help is very much appreciated!

The T-SQL query runs in less than 1 second.  I'm clearly messing something up.

Thanks.

An Error Occurred - Outlook App

$
0
0

Hi All,

When downloading the Outlook app, then inputting credentials for my work mails, I seem to get a "An Error Occurred" status when going to the password page on Office 365.

- I have tried using a different phone with no luck

- Tried turning data off then adding credentials, with still no luck

- Navigating to settings and adding account this way, again no luck

Not sure if i have a security certificate missing?? When I log in using the web browser, I have no issues.

Thanks

Cube Browser returns only NULL values

$
0
0

I am new to SSAS and have been practicing building dimensions and cubes.

I have been using the Adventure Works DW for my practice.

Several times this issue has happened to me.

When I go into the cube browser and pull in some measures all that is returned is NULL.

Currently it is only happening for fact internet sales, fact reseller sales is fine.

This was working correctly.

I read some articles on this issue and nothing so far has helped.

I usually end up resorting to deleting and rebuilding the cube.

When I go into SQL Management Studio and attempt a very basic MDX query on the same date all that is returned is #error

This is a very frustrating product.

Errors seems to happen out of the blue and very little descriptions to go on

Also I am finding out someone else is having the same problem.

Any help would be greatly appreciated

Thanks

dax measure to get the previous year value for each account in table

$
0
0

I have the following data in a table called 'AQPR Values':

I also created another table called 'AQPR Date' which is a standard date dimension with a row for each date.  Here is some columns from that table:

I joined the 2 tables on the date key (reportdatekey = DimFmgDtId).  I then created a measure in 'APQR Values' to get the previous PVR Acct Variance field for each year and account:

    

Previous Year PVR Acct Variance:=CALCULATE(
       max ( 'AQPR Values'[PVR Acct Variance]),
            PARALLELPERIOD ( 'AQPR Date'[Date], -1, YEAR )
        )

However, when i create a pivot with Year from the 'AQPR Date' table, PVR Acct Variance and Previous PVR Acct Variance, it is blank:

I think i need to somehow use the acct no in the filter as well, but not sure how.  I think the measure needs to iterate over the rows, but i couldn't figure out how to do that.


DAX formula to join two tables

$
0
0

Hi,

I have two tables, one table has the day worked, the minutes and the code.

The second tables has the code and the amount that an hour is worth. 

For example, the hour work under code OT1 is worth whatever the person is making times 1.5 (if the person is making 5, then it will be 5 * 1.5)




I need to create a measure that will give me the minutes worked per day multiplied by the code type (most day there are a lot of codes going on).

Thanks


Internal error: An unexpected error occurred (file 'mdcalccover.cpp', line 259, function 'MDCalcCover::BuildCover')

$
0
0

Hi,

I m getting this weird error when i run a MDX query.

Internal error: An unexpected error occurred (file 'mdcalccover.cpp', line 259, function 'MDCalcCover::BuildCover')

The SSAS version is 11.0.6020.0


Thanks,

Anand

Count of rows still in introductory period

$
0
0

Given the fact and dimension table below, we need to determine how many rows there are which are still in their initial 3 month intro period, given a date context.  So for example, if 2 subscription were sold on January 1 2018 and one on February 1 and the into period is 3 months, 3 subscriptions would be in their intro period on March 1  and one would still be in its intro period on April 1.  The fact table has dateID keys for the start and end of the intro period The fact table uses an active relation to the date Dim on the orderDateID and inactive relations on the other dates.  Would it be possible to create a DAX measure that counts the subscriptions that are still in their intro period when a given date is selected?  SSAS tabular.


CREATE TABLE [FactSubscription](
[SubscriptionKey] [int],
[ProductID] [int] NOT NULL,
[OrderDateID] [int] NOT NULL,
    [SubscriptionStartDateID] [int] NOT NULL,
[SubscriptionEndDateID] [int] NOT NULL,
    [IntroPeriodStartDateID] [int] NOT NULL,
    [IntroPeriodEndDateID] [int] NOT NULL,
[Amount] [decimal](18, 8) NOT NULL



CREATE TABLE [DimDate](
[DateID] [int] NOT NULL,
[CurrentDate] [date] NOT NULL,
[CurrentDateName] [nvarchar](64) NOT NULL,
[CurrentDayofWeekName] [nvarchar](64) NULL,
[CalendarYear] [int] NOT NULL,
[CalendarMonthName] [nvarchar](64) NULL



John Schroeder

Getting Error Message: A fact relationship cannot be defined, when I try to define Fact Relationship in SSAS Multidimensional under Dimension Usage Tab

$
0
0

Getting this error message when try to define Fact/Degenerated relationship between cube Dimension and Measure group under Dimension Usage Tab. 

A fact relationship cannot be defined. The dimension and measure group must be based on the same table in the same data source view.

When I checked my Dimension, found that It is coming from One Data Source View and Measure Group from Different Data Source View but It is a valid scenario.

We have more than 7 cubes in a single SSAS Database. For each cube we have separate Data Source View but we have common Dimension across Cubes. So Few common dimensions are coming from 1st Data Source View and one dimension is degenerated dimension  (Using Same table for Fact and Dimension in Cube). 

When Measure Group and Dimension is coming from One Data Source View than It allows us to define Fact Relationship between them. 

If Measure group is from one DSV and Dimension is from another DSV and try to define fact relationship, It throws above error. 

To handle this I just establish Regular relationship  when Measure group is from one DSV and Dimension is from another DSV.

Is this right way to do this or do we have other alternatives? 

https://bennyaustin.wordpress.com/2011/07/21/ssas-what-could-be-wrong-if-you-get-%E2%80%93-%E2%80%98a-fact-relationship-cannot-be-defined%E2%80%99/



Thanks Shiven:) If Answer is Helpful, Please Vote

Different complexity of data extraction from cube via excel 2013

$
0
0

When user connect to SSAS cubes 2015(cube size is approx 15-16 GB) from excel 2013. they browse the cube data by selecting the different combination of dimensions attributes and facts measures.
This combination in excel to fetch the cube data can be simple or complex.
I have a requirement from client where I have to come up with the different types of these combination to fetch data which can be described as Simple, Moderate and Complex.

[For example(I have to come up with something like this):

1. fetching data for less than 5 measures within the same measure group  against less than 10 dimension is Simple Extraction.
2. Fetching  data for more than 5 and less than 10 measures against more than 10 dimesions within the same measure group is moderateExtraction.
3. fetching ata for more than 10 measure across multiple measure groups against more than 15 multiple dimensions attributes considered as Complex Extraction]

Do anyone has any experience /knowledge/idea on working on such type of request.  Any comment / idea / suggestion will be a great help.

Getting Error: MdxScript(CubeName) (575, 33) The level '.&[Hero]' object was not found in the cube when the string, [product].[category].[bikes].&[Hero], was parsed.

$
0
0

Hi All,

I am getting this error when processing cube. I know that all the underlying Tables are empty (not having any data)

MdxScript(CubeName) (575, 33) The level '.&[Hero]' object was not found in the cube when the string, [product].[category].[bikes].&[Hero], was parsed.

When I checked Cube-Calculations found below scope which is causing this issue. 

SCOPE (measures.[sales amount], [product].[category].[bikes].&[Hero],
[Date].[Calendar].[Q4 CY 2002]);
THIS = ([product].[category].[bikes].&[Hero], [Date].[Calendar].[Q4 CY 2002]) *
1.3
END SCOPE;

I understood the reason of this error but not sure how to fix this? As my underlying tables are empty and so it is not able to find &[Hero] during process time and failing. But there is a possibility that tomorrow data related to Bikes Hero has been completely removed from underlying table and not going to be loading any more. In this case this scope will start throwing error. How to make sure even underlying data is there or not such SCOPE should not throw error?

I found this but not clear to me:

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/148bfc09-0af8-4c5d-9ab6-46758c138f98/conditional-mdx-?forum=sqlanalysisservices

SCOPE explained in nice Way:

https://www.sqlservergeeks.com/sql-server-implementing-calculations-in-ssas-using-mdx-part-3/ 


Thanks Shiven:) If Answer is Helpful, Please Vote

Ratio to Parent by Multiple Dimensions on both Row and Column Axes

$
0
0

Hi,

I recently read "Percentage of Parent for all dimensions" thread ...To say the least, it was eye-opening...The amount of effort and detailed explanation that Tomislav Piasevoli put in was tremendous and helpful. I'm doing the same thing for our BI requirements, and I practically copied the entire code and see that it works for dimensions that are being identified on both Axes (Column / Row). However, the code is not a perfect solution for my situation…It seems that the calculation only works for any single Dimension on each Axis.  If I select more than one dimension onto the Colum / Row axes, the results came out incorrectly for the inner dimensions.


Note that: The possible dimensions that will be used for the “Ratio to Parent” are as follows:

Geography

Carrier

Plan Type

Time (Plan Year)

 

The Code that I used is as follows:

 

CREATEMEMBERCURRENTCUBE.[MEASURES].[Count of columns]

 ASiif(IsError(Axis(0).Count), 0, Axis(0).Count),

VISIBLE = 1; 

 

CREATEMEMBERCURRENTCUBE.[MEASURES].[Count of rows]

 ASiif(IsError(Axis(1).Count), 0, Axis(1).Count),

VISIBLE = 1;  

 

CREATEMEMBERCURRENTCUBE.[MEASURES].[Ratio Universal]

 ASiif( [Measures].[Count of rows] > 0,

 

iif( Axis(1).Item(0).Item(0).Hierarchy.CurrentMember.Level.Ordinal = 0,1,

 

      [Measures].[Plan Count]/

 

     ( Axis(1).Item(0).Item(0).Hierarchy.CurrentMember.Parent,[Measures].[Plan Count] )),

 

iif( [Measures].[Count of columns] > 0,

 

iif( Axis(0).Item(0).Item(0).Hierarchy.CurrentMember.Level.Ordinal = 0,1,

 

    [Measures].[Plan Count] /

 

     ( Axis(0).Item(0).Item(0).Hierarchy.CurrentMember.Parent,[Measures].[Plan Count])),

1)),

FORMAT_STRING = "Percent",

VISIBLE = 1  ;

 

Sincerely thank you very much in advance for your time and assistance!

Create hierarchies in non-parent child dimensions?

$
0
0
Hi,

I have a simple table:

[Product]
------------
[Id]
[Name]
[Price]

Now I'm trying to create a SIMPLE dimension with only the following attributes
[Id] *** as key attribute
[Name]

This is to purely get a distinct list of product names,
It processes and deployes successfully, and the dimension is working great,

HOWEVER there is this nagging warning which i cannot figure out...
(it appears on the dimension root node)

Create hierarchies in non-parent child dimensions?

The default relationships created are:
Id -> Name ??

I.W Coetzer

Consequences of AttributeHierarchyOptimizedState NotOptimized

$
0
0

I am a bit confused on this point.  Does setting the state of AttributeHierarchyOptimizedState of an attribute to NotOptimized affect the performance of a user defined hierarchy if that attribute is used in it?

 

From my reading it seems that it shouldn't.  In my interpretation this property is used to control whether or not accessing the members using this attribute only is what is affected.  If I have a user defined hierarchy with an attribute in it then as long as the members are accessed through that hierarchy it should still be optimized.  Am I correct on this?

Getting this Waring Message in SSAS Multidimensional cube: Avoid defining many-to-many relationships when either the intermediate measure group or any of the intermediate dimensions have 1 million or more rows

$
0
0

Avoid defining many-to-many relationships when either the intermediate measure group or any of the intermediate dimensions have 1 million or more rows.

is this going have server impact on performance? Is there alternatives? 


Thanks Shiven:) If Answer is Helpful, Please Vote

OLE DB error when processing dimensions in Analysis services using AMO with only TLS1.2 enabled on the server

$
0
0

Hi,

I recently enabled TLS1.2 exclusively(only 1.2 enabled with all others like TLS1 and SSL disabled) on my SQL server. I installed all necessary patches mentioned in:

https://support.microsoft.com/en-us/help/3135244/tls-1-2-support-for-microsoft-sql-server

My program is able to connect to the sql server and everything works fine except the operations on the analysis service using AMO. 

Some extra info:
Windows server 2012 R2
SQL service 2014 sp2
.Net Framework 4.7


The sample test code is shown below, nothing special but going to process the dimensions:


using Microsoft.AnalysisServices;

try
{
using (var server = new Server())
{
server.Connect("localhost");
server.CancelCommand();
using (var database = server.Databases["mydb"])
{
foreach (Dimension dim in database.Dimensions)
{
dim.Process(ProcessType.ProcessFull);
}

}
Console.ReadLine();
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}

A exception thrown as below when calling the dim.Process(ProcessType.ProcessFull). As shown, it is able to connect to the server and list the databases and dimension but failed to process the dimensions.
It was a connection issue based on the information, I am pretty sure it is caused by the upgrade to TLS1.2, because the same code worked before. 


Microsoft.AnalysisServices.OperationException: Internal error: The operation terminated unsuccessfully.
OLE DB error: OLE DB or ODBC error: [DBNETLIB][ConnectionOpen (SECDoClientHandshake()).]SSL Security error.; 08001.
Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of 'EM Data Mart', Name of 'EMDataMart'.
Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of 'E Mdim Data Series', Name of 'Actual Baseline Forecast' was being proc
essed.
Errors in the OLAP storage engine: An error occurred while the 'Display Order' attribute of the 'Actual Baseline Forecast' dimension from the 'EnergyManager' da
tabase was being processed.
Server: The current operation was cancelled because another operation in the transaction failed.

   at Microsoft.AnalysisServices.Core.AnalysisServicesClient.SendExecuteAndReadResponse(ImpactDetailCollection impacts, Boolean expectEmptyResults, Boolean thro
wIfError)
   at Microsoft.AnalysisServices.Core.AnalysisServicesClient.Process(IMajorObject obj, ProcessType type, IBinding source, ErrorConfiguration errorConfig, WriteB
ackTableCreation writebackOption, ImpactDetailCollection impact, XmlaWarningCollection warnings, JaXmlSerializer serializer)
   at Microsoft.AnalysisServices.Core.Server.Process(IMajorObject obj, ProcessType processType, IBinding source, ErrorConfiguration errorConfig, WriteBackTableC
reation writebackOption, XmlaWarningCollection warnings, ImpactDetailCollectionimpactResult, Boolean analyzeImpactOnly)
   at Microsoft.AnalysisServices.Core.Server.SendProcess(IMajorObject obj, ProcessType processType, IBinding source, ErrorConfiguration errorConfig, WriteBackTa
bleCreation writebackOption, XmlaWarningCollection warnings, ImpactDetailCollection impactResult, Boolean analyzeImpactOnly)
   at Microsoft.AnalysisServices.ProcessableMajorObject.Process(ProcessType processType, ErrorConfiguration errorConfiguration, XmlaWarningCollection warnings)
   at Microsoft.AnalysisServices.ProcessableMajorObject.Process(ProcessType processType)
   at AMOTest.Program.Main(String[] args) in C:\Oliver\My Docs\VS Projects\TLSTest\AMOTest\Program.cs:line 33


Any help on this issue would be appreciated.

      

Last Year or Parallel Period of existing Calculated Measure

$
0
0

Good day, I need help

I have a Calculated Measure "Actual Efficiency Lt/100Km" that I need to get the Last Year Value

CREATE MEMBER CURRENTCUBE.[Measures].[Actual Efficiency Lt/100Km]
 AS IIF([Measures].[Total Actual Litres]=0 OR [Measures].[Total Actual KM]=0,NULL,([Measures].[Total Actual Litres]/([Measures].[Total Actual KM]/100))), 
FORMAT_STRING = "#,###.##", 
NON_EMPTY_BEHAVIOR = { [Measures].[Total Actual Litres], [Measures].[Total Actual KM] }, 
VISIBLE = 1 ,  ASSOCIATED_MEASURE_GROUP = 'Measures'; 

I need to create a New Last Year Calculated Measure "Actual Efficiency Lt/100Km LAST YEAR" based on existing calculated measure ""Actual Efficiency Lt/100Km"

Please Help!



MDX: return last value for selected items in Power BI

$
0
0

This is a question regarding SSAS Cubes, MDX formulas and Power BI.

I have a measure with the active members per each month. So when I select for example 2018 it shouldn´t aggregate but return the last available month with active members, and if I break down by month it should give the active members for each month.

So I have this formula which works almost fine if querying in MS Management Studio:

with member [Measures].[Last existing SOCIOS] AS 
Max(
EXISTING [DIM FECHA].[Jerarquía].[MES NOMBRE].members,
iif([Measures].[ACTIVOS] = 0,null,
[Measures].[ACTIVOS])
)

 select {[Measures].[Last existing SOCIOS]} on columns,
[DIM FECHA].[MES NOMBRE].members on rows
from [cubo_Compromisos]
where [DIM FECHA].[AÑO].&[2018]

This returns the value for october at the 'All' level instead of the real last value which is the value for November. But this is not my main problem. The real issue is that when I use this measure in Power BI it behaves differently: when selecting multiple months it ignores the selected values and just returns the last value for the whole year.

This forum doesn´t allow me to add photos or links until I get verified. But you can see the same question here with photos which makes it easier to understand:

'https://stackoverflow.com/questions/53389067/mdx-return-last-value-for-selected-items-in-power-bi/53390438#53390438'

Does anyone know the right MDX function to use or an alternative

Thanks

Viewing all 14337 articles
Browse latest View live


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