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

Getting a distinct count of returning customers from AdventureWorks

$
0
0

I am currently attempting to get a distinct count of returning customers from the Adventure Works cube on a month by month basis.

So if the customer made one to many purchases in October 2014 and November 2014, then they will be counted once in November 2014.

If they are in October 2014 but not in November 2014, then they don't get counted.

If they are not in October 2014 but they are in November 2014 then they don't get counted. 

My query currently looks like this:

WITH
MEMBER MEASURES.[Returning Customers] AS
DISTINCTCOUNT(
NONEMPTY(
NONEMPTY(
[Customer].[Customer].MEMBERS
, [Measures].[Sales Amount])
, {[Measures].[Sales Amount]}
* [Date].[Calendar].[Month].CURRENTMEMBER.PREVMEMBER
)
)
SELECT
{
MEASURES.[Returning Customers]
} ON COLUMNS,
[Date].[Calendar].[Month].MEMBERS ON ROWS
FROM [Adventure Works]

This shows the list of months, but every column has an #Error. What am I doing wrong?



USERNAME() + mailadress in Tabular 2016

$
0
0

Hi all,

I want to have the mailadress of people using our Tabular 2016 cube. I can't use USERPRINCIPALNAME() in 2016, only USERNAME(). This gives me DOMAIN\USERNAME instead of the mailadress. My DWH doesn't have the username, but has the mailadresses. So I really would like to receive the mailadress in my DAX.

Is there a way to achieve this? In my cube or in a AD-setting or something?

Compare own department or cost center with rest of organisation

$
0
0

Hi all,

I'm having much problems with comparing a persons department with the whole organization.

What I have now is this:

Total: 100.000
My department: 6.000

I don't need RLS, because of that I want to have 100.000 as total. But I want to be able to generate 100.000 and 6.000, depending on what you choose in the datamodel. In the end it must come to a Power BI report where you see both numbers.

I'm familiar with RLS and I've used it many times; it works always. But what I want do now is harder to me. Is there anybody who can help me?

I've tried to create this model:

But this doesn't work. What I receive is not what I want; when I use a field from rights you receive the sum of Measure1 and Measure2 for every department where rights are granted. And when I grab a field from unique departments table I receive the total sum of Measures.

So this is not the way.... But I don't know what to do.

I started with another idea; adding a 'is_my_department' which gives a 0 or 1 and then simply filter everything on this field. But I tried to fill this field with some DAX based on related and username(). But the problem is that you can't use username() in a calculated column.

Summary:

So the question is; is there anybody who has a great idea for me to make it possible to see which is your own department and which is not? So that I could see the total value of measure and the total which belongs to the departments which are present in the rights table with my mailadress.

MDX Where clause performance

$
0
0

Hi all.

I'm new to MDX, as you're about to see...

We report from excel via a MOLAP cube and get loads of performance problems when filtering. In the below where clause (traced from excel) with the "sales" member (currently commented out) the MDX takes 10 mins to run. I moved the tuple (?)  to the select section and the MDX returns instantaneously. I though the where clause should speed things up since it's only getting the required slices *and then* selecting from it.

I know it's probably a daft question, but i'm struggling to understand this. Effectively i'd like to get the query running with the filter but not 10 minutes worth. Any ideas? Thanks in advance.

SELECT NON EMPTY HIERARCHIZE( { DRILLDOWNLEVEL( { [Company].[Company].[All] },,, include_calc_members ) } ) DIMENSION PROPERTIES parent_unique_name, hierarchy_unique_name, [Company].[Company].[Company].[Region Name] ON COLUMNS FROM (SELECT ( { [Accounting Date].[Year - Quarter - Month - Date].[Month].&[201907], [Accounting Date].[Year - Quarter - Month - Date].[Month].&[201908], [Accounting Date].[Year - Quarter - Month - Date].[Quarter].&[20191], [Accounting Date].[Year - Quarter - Month - Date].[Quarter].&[20192] }

***Moved from where clause to here as a test*** ,[Account].[Main Accounts by Category].[Category].&[SALES]

******************************** ) ON COLUMNS FROM [Global Accounting Ledgers]) WHERE ( --[Account].[Main Accounts by Category].[Category].&[SALES], [Currency Conversion Date].[Currency Conversion Date Calendar].[Date].&[20190831], [Measures].[Reporting Amount Publish] ) CELL PROPERTIES value, format_string, language, back_color, fore_color, font_flags




Microsoft Visual Studio error: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

$
0
0

Hi,

When I try to open my model.bim file with the Tabular Model Designer on the Microsoft Analysis Services Project solution.

I keeps giving me the following error:

microsoft visual studio error:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

When I look further into this problem I saw the following error:

Invalid token 'Text' at root level of document could this be the problem? Any suggestions?

Thanks

XMLA for the processing all dimensions

$
0
0

Hi,

Instead of AMO  if possible to process the all the dimensions of the given cube.

I am creating a package where i will give the server name and DatabaseID where it shuold get all the dimensions in the Cube and process them.

Thanks,

Santosh

SSAS OLAP Security

$
0
0

Hi I hope this is the correct forum to raise this question.

I've a OLAP cube that has AD Groups assigned within the roles. 

Users access the OLAP cubes via excel through a creating a excel connection file from datasource and via a connection string with however how do I enforce users who share excel reports to update there security "let excel know there Ad account" when they refresh there excel report.

Thanks

How to do DISTINCT on multiple columns in DAX query?

$
0
0

Hello Everyone!

I am pretty new to the DAX world. I am trying to do get distinct records on multiple columns in DAX query similar to the way I do in SQL. I tried joining two tables based on the model in the Query Designer which gave me the following query.

EVALUATE SUMMARIZECOLUMNS(
'Dim_Products'[SaleCode], 
'Dim_Products'[ProducttName],  
'Dim_TimeZone'[StartDate], 
'Dim_TimeZone'[StartTime], 
'Dim_TimeZone'[EndDate], 
'Dim_TimeZone'[EndTime], 
'Dim_TimeZone'[Variation],  "Fact_Sales_Count", [Fact_Sales_Count]
)

Running the above is giving duplicate records. How do I just get distinct records as I am trying to call this from SSRS?

Thanks!


Known is a DROP, Unknown is an OCEAN.


Issue connecting to the cube

$
0
0

Hi,

I have an issue when connecting to a MDM SSAS cube. We have made recent changes change to the underlying mart tables and had to reflect the same in the cube. But on making the changes, we weren't able to connect to the cube but the perspectives are working fine. The error i am getting is as follws.

"Data couldn't be retrieved from database. Check the database server or contact you database administrator. Make sure external database is available, and then try the operation again.".

I tried to rebuild the connection but it is not of any help.

Issue Processing tabular model through SQL server agent Jobs

$
0
0

Hi,

We have oracle DB as datasource. We built tabular model creating oracle as datasource and published to SQL server tabular server. we trying to  process the database(Process mode is full) manually the process was successfull. To automate this steps we created the Job & scheduled to process the data in tabular database

When running the job we get below error message.

Message
Executed as user: USPHC\996889. <return xmlns="urn:schemas-microsoft-com:xml-analysis"><root xmlns="urn:schemas-microsoft-com:xml-analysis:empty"><Messages xmlns="urn:schemas-microsoft-com:xml-analysis:exception"><Warning WarningCode="1092091904" Description="Note. Analysis Server has persisted any security information specified as part of the Connection string portion of the Datsource object definition." Source="Microsoft SQL Server 2017 Analysis Services Managed Code Module" HelpFile="" /></Messages></root></return>.  The step failed.

Thanks in Advance.

Raghav

SSAS Feature analyze in excel From SSMS taking to Adobe Acrobat Reader File instead of Excel File?

$
0
0

Hi All,

I have problem with the SSAS Feature "analyze in excel". When I connect to SSAS cube from SSMS and browse a cube in SSMS, we can see a Excel Icon that is "analyze in excel".

When we click It browse the cube in excel but in my case when I click on it It takes me to "Adobe Acrobat Reader". 

Do we know What I have to do to correct this..?


Thanks Shiven:) If Answer is Helpful, Please Vote

The JSON DDL request failed with the following error: Cannot execute the Refresh command: database

$
0
0

I am encountering a problem when trying to automate the processing of a Tabular database within a SQL Server Agent Job.  When I run the below script, it runs successfully from SSMS:
{

  "refresh": {
    "type": "full",
    "objects": [
      {
        "database": "Flash"
      }
    ]
  }
}

However, when I add it to a SQL Job Step:

The following error returns:

Microsoft.AnalysisServices.Xmla.XmlaException: 
The JSON DDL request failed with the following error: 
Cannot execute the Refresh command: 
database 'FLASH' cannot be found..       
at Microsoft.AnalysisServices.Xmla.XmlaClient.CheckForSoapFault(XmlReader reader, XmlaResult xmlaResult, Boolean throwIfError)     
at Microsoft.AnalysisServices.Xmla.XmlaClient.CheckForError(XmlReader reader, XmlaResult xmlaResult, Boolean throwIfError)     
at Microsoft.AnalysisServices.Xmla.XmlaClient.SendMessage(Boolean endReceivalIfException, Boolean readSession, Boolean readNamespaceCompatibility)     
at Microsoft.AnalysisServices.Xmla.XmlaClient.SendMessageAndReturnResult(String& result, Boolean skipResult)     
at Microsoft.AnalysisServices.Xmla.XmlaClient.Execute(String command, String properties, String& result, Boolean skipResult, Boolean propertiesXmlIsComplete)     
at Microsoft.SqlServer.Management.Smo.Olap.SoapClient.ExecuteStatement(String stmt, StatementType stmtType, Boolean withResults, String properties, String parameters, Boolean restrictionListElement, String discoverType, String catalog)     
at Microsoft.SqlServer.Management.Smo.Olap.SoapClient.SendCommand(String command, Boolean withResults, String properties)     
at OlapEvent(SCH_STEP* pStep, SUBSYSTEM* pSubSystem, SUBSYSTEMPARAMS* pSubSystemParams, Boolean fQueryFlag)

I've read through blogs and msdn articles but it almost seems like this is a compatibility issue between versions of SQL 2016 and other SQL versions?  Has anyone encountered and resolved this yet?  Is there a service pack that hopefully resolves this I hope?

Thank you!!

SSAS Dimension not shown in the Browser

$
0
0

Hi All,

I have an Production Cube with 23 Measure Group and 18 Dimensions. This cube was good and they wanted me to do perfomance tuning in this cube based on Microsoft Suggessions. As per Microsoft, I find some attribute relationship errors(Since the atribute/Level name has been chaged after attribure relationship was given) and Key column and name column was not properly defined(changes done in all dimension except one or 2). I corrected these and setted Default Measure as a Null Caluculated measure as in the Microsoft Suggessions with the help of http://sqlblog.com/blogs/jorg_klein/archive/2009/02/06/ssas-speed-up-dimensions-using-a-null-default-cube-measure.aspx

Now, After deploying the solution i found that only 10 Dimensions are listing and 8 Dimensions are not listing in Bids Browser and in SSMS Browser.

Thinks Checked:

1. Visible properties of those 8 missing Dimension are checked, both in Cube -> Cube structure -> Dimension proerties and in the Dimension Atribute and level properties(AtributeHierarchyEnable and visible).

2. Tried removing the  Default Measure.

3.Tried Deleting and deploying the cube.

Things found:

while quering the Cube with MDX in SSMS. I am able to query the cube with the missing dimension and data is shown with out any errors.

Please help me break out this puzzle... I will reward you by marking the correct answer.. ;)


Please vote as helpful or mark as answer, if it helps Regards, Anand

Import from SSAS tabular memory issues.

$
0
0

Hi all,

I'm having a bizarre issue importing data from a SSAS tabular model (SQL 2017 standard edition 64 bit) to client tools like Excel or PowerBI (both 64 bit).

While live connections are working fine, importing data from the model causes a massive increase of memory used on the server until the client application simply returns an error stating it ran out of memory.

The model itself is tiny: 17,5 MB. (The underlying SQL datawarehouse is only 200MB in size.) The model is a basic star schema.

I've removed all measures, KPI's and calculated columns from the model, and set all relations to single filter direction. Still this issue persists.

The import works when just importing the fact table without any of the dimensions, but as soon as I add even one (small) dimension, the memory used seems to grow infinitely and the server grinds to a halt.

Any help would be much appreciated!

Grtz,

C

SSAS database backup

$
0
0

Hi All,
I tried to backup SSAS databases(2008 R2) by using query in SSMS, but it is overwriting previous day backup.How to take backup without overwriting previous day backup. I need to maintain at least 7 days of backup.


Regards,
Vignesh


How to see the existing hierarchies in SSAS Tabular Model

$
0
0

Hello,

I can see there are existing hierarchies while browse the cube in SQL Server, where as i am not able to see the same hierarchies in .bml file in visual studio? Can someone tell me how to add back the hierarchies from the existing cube or they are hidden some where? 

Here is the image of Customer Dimension with Address, Common, Dates hierarchy from SQL server

Here is the image from Visual studio 

Thanks,

Shyam Maddi.


Thanks, Shyam.

MDX For Lag calculation Help

$
0
0

Hello,

I have to calculate the standard deviation of the 10 previous value of a measure X over the date hierarchy: Something like that:

+------------+---------+---------+
|    Date    |    X    |  std10d |+------------+---------+---------+
| 24/04/2019 | 238985  |         |
| 25/04/2019 | 61567   |         |
| 26/04/2019 | -37350  |         |
| 27/04/2019 | 27482   |         |
| 28/04/2019 | 65499   |         |
| 29/04/2019 | 3373    |         |
| 30/04/2019 | 88660   |         |
| 01/05/2019 | 22094   |         |
| 02/05/2019 | 99731   |         |
| 03/05/2019 | -4878   |         |
| 04/05/2019 | -100024 |   77268 |
| 05/05/2019 | -54204  |   60966 |
| 06/05/2019 | -9833   |   63679 |+------------+---------+---------+

I khow that the MDX formula should be like that :

stdev
(
[00_Time].[0_dateHierarchy].PrevMember.Lag(9) : 
[00_Temps].[0_dateHierarcy].PrevMember, 
[Measures].[X]
)

But I don't know what condition add to prevent the calculation of the first 10 value of std10d.


How to get error message from AAS Asynchronous Refresh?

$
0
0

So we have a custom cmd line tool that uses the REST API provided by AAS . The problem is that if it fails all we get is an indicator that a GUID failed. Any chance we can get the actual error message that we can return via the client?

Thanks for any thoughts

unable to update StringStoreCompatiblityLevel

$
0
0

Dimension procesing is failing with the error

File system error: A string store or binary store with a compatibility level of '1050' is at the maximum file size of 4 gigabytes.

AS suggested, i modified the StringStoreCompatiblityLevel. but no use still the Dimension processing fails.

https://docs.microsoft.com/en-us/analysis-services/multidimensional-models/configure-string-storage-for-dimensions-and-partitions

Property StringStoresCompatabilityLevel shows 1100 after update, but the readonly parameter

CurrentStringStoresCompatabilityLevel is still 1050.

I am using SQL Server 2014.

The Cube database and server compatibility is at 1100

Thanks inadvance.

how to perform partial cube processing without losing data.

$
0
0

Hi All,

I have cube where measure groups are partitioned into 2 partition for different time frame as below:

1. latest 2 years data ( PRT_DATA_2YEARS )

2. older data than 2 years ( PRT_DATA_REST )

By processing 1st partition ( with any of processing option ), How can I make sure to process/refresh only last 2 years of data? Meaning only latest 2 years of data will be updated and rest of the data will be intact.

Example: lets say actual data on database got updates for all years. and till now cube has not reflected those changes because it hasn't processed yet. Now we run cube processing job, that will update or fetch updated data only for latest 2 years in the cube. And rest of the data will be intact. There will not be any change in the cube data which is older than 2 years.

Request you to please help to resolve this.

Any suggestions/hints/trick are welcomed.

Regards



Viewing all 14337 articles
Browse latest View live