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

Cube Partitioning taking more time than usual for SSAS cube process

$
0
0

Hi,

Previously SSAS DB processing using SSIS package(analytics Services processing task) was taking 6 hours to complete with synchronization.

I tried and partitioned all cubes in that DB into 3 partitions i.e. 1 year, 2 year and rest all. And also created SSIS jobs as below and parallely distributed many partitions into 8 SSIS task so that it also can process in parallel while processing other partitions:

1st. it will pick 1 year partitions for latest 1 year data,

2nd. it will pick 1 year and 2 year partitions for latest 2 year data,

3rd. It will pick 1 year, 2 year and rest all partitions for all of the data.

I executed 3rd SSIS job, which actually first processing all dimensions, then all partitions in 8 parallel tasks and then synchronizing db to query server. But it is taking more than 12 hours.

In previous processing, SSIS task used to select only SSAS DB name, but now I used to select every SSAS object within the task to make it run parallel.

Since 3rd job executing all SSAS DB objects, like previously it was processing whole ssas DB, I was expecting atleast it should be completed in same time (6 hours) but it took double.

Not sure what went wrong , can anyone please assist. any info/suggestion will be helpful

Regards,


Using inactive relationships with dates

$
0
0

Hi all, having trouble recreating something in an Analysis Services Tabular model that I've been able to do in Power BI. I have a Date dimension table with an active relationship to an orders table, the order is also related to a delivery table. An order relates to a subscription for instance that is delivered over a period of time. I want to be able to look at the delivered revenue over time as well as the order value by date.

In Power BI, I can do this by creating an inactive relationship between my date table and my delivery table, then use USERELATIONSHIP in the measure to calculate across the correct time frame.

Power BI Inactive Relationship

When I try to do the same thing in Analysis Services however, I get the error about an Ambiguous path, even though I am explicitly marking it as inactive. Is this option just not supported in Analysis Services, or am I overlooking something in one of my other relationships that may be prohibiting it?  Alternatively, does anyone have any other suggestions as to how I can achieve something similar? 

I realise I could create an additional Date Dimension table but I'm trying to build a self service reporting model and want to keep it as easy to use as possible and make the measures do the work wherever I can!

Any help and suggestions massively appreciated. 

MDX Generate calculated member

$
0
0

Hi All,

I am hoping you can help me..... basically I am trying to speed this up:

SUM
        (
        GENERATE (EXISTING [Month Set]
                    ,{
                        PARALLELPERIOD
                                (
                                    [Billing Month].[Simple Calendar].[Year]
                                    ,1
                                    ,[Billing Month].[Simple Calendar].CURRENTMEMBER
                                )
                    }
                )
            ,DIVIDE([Measures].[Invoiced Sales],[Measures].[Working Days])*
                        (PARALLELPERIOD
                                (
                                    [Billing Month].[Simple Calendar].[Year]
                                    ,-1
                                    ,[Billing Month].[Simple Calendar].CURRENTMEMBER
                                ),
                        [Measures].[Working Days]
                                )
         )

This is the Month Set referenced in the above:

[Billing Month].[Simple Calendar].[Month]

Here is an example of what I want returning the comparable sales column which does: (Sales Prior Year / Working Days Prior Year * Working Days)



The issue is as soon as it queries granular data performance is awful. I have tried this :

CREATE MEMBER CURRENTCUBE.[Measures].[PY Working Day Test]
 AS (PARALLELPERIOD([Billing Month].[Simple Calendar].[Year],1,[Billing Month].[Simple Calendar].CURRENTMEMBER)
            ,[Measures].[Working Days]
            ), 
VISIBLE = 1;          

CREATE MEMBER CURRENTCUBE.[Measures].[PY Test]
 AS (PARALLELPERIOD([Billing Month].[Simple Calendar].[Year],1,[Billing Month].[Simple Calendar].CURRENTMEMBER)
                                
            ,[Measures].[Invoiced Sales]
            ), 
VISIBLE = 1; 

CREATE MEMBER CURRENTCUBE.[Measures].[PY Comp Test]
 AS SUM(GENERATE([Billing Month].[Simple Calendar].[Month].MEMBERS,{[Measures].[Comparable Sales Hidden]},DESCENDANTS([Billing Month].[Simple Calendar].[Year].CURRENTMEMBER,[Billing Month].[Simple Calendar].[Month]))), 
VISIBLE = 1  ;  

Obviously Descendants isn't correct but the prior year test measure performs well.

Can anyone suggest how to go about speeding this up? I also need to put this as a calculated member.

Many thanks,

Joe



Not able to connect with the SSAS Cube from Excel

$
0
0

Whenever I am trying to connect to a specific cube in Analysis Services in Excel, it gives me the error 'data could not be retrieved from the database. Check the database server or contact your system administrator. Make sure the external database is available, and then try the operation again.' I am able to access all the other cubes but just this specific ones. 

Have already checked the permissions and visibility of the cube. Everything looks fine.

Please help

SSAS presenting error of lack of support for ODBC

$
0
0

Guys,

I am migrating a model from 1200 to 1400 version and I am getting the following error.

Erro COM : System.Data; The .Net Framework Data Provider for OLEDB (System.Data.OleDb) does not support the Microsoft OLE DB Provider for ODBC Drivers (MSDASQL). Use the .Net Framework Data Provider for ODBC (System.Data.Odbc)..

The model uses a ODBC data source that works fine in the 1200 model but it is not working for 1400. Someone has experienced this kind of issue?

Date format to d/M/yyyy h:mm:ss tt

$
0
0

I have SQL Server 2017 SSAS Tabular Model. I see date format like M/d/yyyy h:mm:ss tt, but cannot see format d/M/yyyy h:mm:ss tt. It is important format in local culture.

How to enable?


Kenny_I

MDX query to loop and sum specific values from column and show only the highest sum

$
0
0

Hi, I'm new to MDX and trying to do the following and I have no idea where to begin or how to do it. So, I have a Dimension 'DaySlice' that is a 15 minute day slice from a day (00:00 - 00:14, 00:15 - 00:29 and so on) and a column called 'number_of_occurrences'. I need to sum number_of_occurrences by hour, meaning:

00:00 - 00:59 (4 day slices consecutive) = how many number_of_occurrences?
00:15 - 01:14 (4 day slices consecutive) = how many number_of_occurrences?
00:30 - 01:29 (4 day slices consecutive) = how many number_of_occurrences?

ans so on. At the end I need to show the interval where the max number of occurrences happened and the value of the max number of occurrences, for example:

|  interval       |  number of occurrences |
_________________________________

00:15-01:14   |       100.000                 |
_________________________________

 Sorry for not providing what I have already tried, but every result looks like nonsense

"The operation is not supported by the redirector service."

$
0
0

Hey, there!

I configured an HTTP interface through msmdpump.dll for an SSAS instance I have. Last week it was working and I could connect using SSMS to the SSAS through this URL, but today I can't. The only thing I remember doing was installing SQL Server (the database engine) after that, since there were only a couple of SSAS instances, but I may be wrong.

Now, when I try to connect, it throws the following error: "XML for Analysis parser: The operation is not supported by the redirector service. (Microsoft SQL Server 2017 Analysis Services)".

I searched on the Internet about this error, but didn't find even one thread about it, all redirector errors are about the SQL Browser not running.

Thanks in advance!


DAX - IF STATMENT in case a column is empty

$
0
0

Hi,

I have two columns in a table customerid and customergroupid.

not every customer has a group customer.

basically i would like to create a calculated column with the following logic, if customergroup is empty add customerid.

I wrote this but it is giving me errors, and I am not sure why. 

=IF(ISBLANK(Customer[CustomerGroupID_old],Customer[CustomerID],Customer[CustomerGroupID_old]))

thanks

SSAS Permissions - restricting dimension access

$
0
0

I have SSRS reporting set up from an SSAS cube. Reporting contains various dimension data including certain confidential items. I want to set up a role that doesn't have permissions to view the confidential data, but I want those users to be able to run the report and view it, just without those items. I've tried restricting access to the relevant dimension data but then the whole report is blank.

Example - Full report shows -

Name: John Smith

ID: 123456

Gender: Male

City: London

I want to configure the role so they can run the report and see everything except the name

Is this possible?

Error when deploying SSAS Tabular model, "The Upgrade element at line 7..." (Solution)

$
0
0

It is about time I started posting some workarounds I have discovered so others can benefit.  Apologies to all that may have come across this too late.

I received the following error when deploying to a SSAS 2016 tabular model which was originally a 2014 Tabular model.  The solution and SSAS project contained several solution configurations.

Error when deploying metadata:

"The Upgrade element at line 7, column 90 (namespace http://schemas.microsoft.com/analysisservices/2014/engine) cannot appear under Envelope/Body/Execute/Command."

I won't go into my general frustration with Visual Studio SSAS Tabular projects seemingly ignoring solution configurations such that when I want to deploy to staging, it should deploy to one server and when I pick the Solution's Production configuration it should deploy to another server.  BUT, this did nuisance did ultimately lead me to my problem. 

I had several solution configurations, one for staging 2014, production 2014, staging 2016 and production 2016.  Each configuration had a different deployment server, but I had to open the Project in a Text viewer to confirm this since the Visual Studio UI seems to only display the 'last' deployment server selected.  What I ultimately chose to do was while in the text editor with the SSAS Tabular project file, reset all deployment server values to my desired SSAS 2016 host, save the file, open the project in VS again and select Deploy.  At this point I had success.

My only guess here is that under the covers, VS must have been using one of my original SSAS 2014 configurations I created and I was trying to deploy a 2016 Tabular model to a 2014 SSAS Tabular server.

Data Vault DWH Modeling in SSAS

$
0
0

Hallo my expert friends,

Does anybody knows or has experience modeling the DWH under Data Vault?

If so and once it is made, is it possible to implement it with SSAS?

If so, is it possible creating reports either with SSRS and Excel/PivotTables?

In advanced, thank you very much for your insight.

Alex

MDX - previous 3 months aggregate

$
0
0

Hi -

I have a calc that isn't working the way I want. For March 19, I would like to see the aggregate of Dec 18 - Feb 19, For Feb 19 I would like to see Nov 18 - Jan 18 and so on.

This calc works for the first month (March) but fails for the rest

divide(
SUM
(
   [Time].[Fiscal Mo].CurrentMember.Lag(3) :
   [Time].[Fiscal Mo].CurrentMember,
   [HOD Product Family Gp 1 Sales]-[HOD Product Family Gp 1 Drp Shp Sales]
)
,
SUM
(
   [Time].[Fiscal Mo].CurrentMember.Lag(3) :
   [Time].[Fiscal Mo].CurrentMember,
   [HOD Product Family Gp 1 Sales])
)

I have a calculation for the divide step in the example above labeled as HOD % Grp1

Ideally I would like to have the below, but couldn't get that to work either:

Aggregate
(
   [Time].[Fiscal Mo].CurrentMember.Lag(3) :
   [Time].[Fiscal Mo].CurrentMember,
   [HOD % Grp1]
)

how to test the SSAS cubes?

$
0
0

Hi Frds,

I am developing SSAS Cube,

How to test the Cube and How to write the test cases.

Share me cube developer how to test the SSAS cubes.

Please share me & reply me  any test cases document the following E-mail Id:rams804@gmail.com

 

Regards

Rama


Measures with Different Granularity Functionality

$
0
0

Hi,

I have the following measure:  Weighted Score:=DIVIDE (SUM(X),DISTINCTCOUNT(Y))

when the user is filtering / Displaying the measure on the day level i want it to calculate like the above measure, but if the user filters a time range, lets say one month, i want theDISTINCTCOUNT to be calculated on the day level and then sum up all the days distinct counts as the DIVIDE denominator.

hope i was clear.

Thanks!



Easy way to change multiple partition definitions

$
0
0

I have 240+ partitions (4 per month since 2014). I've just removed one dimension and the associated key from the fact table. That means I have to now change the partition definition SELECT statement to remove that column.

I started doing that one partition at a time in Visual Studio and then wondered if there was a quicker way to do it? I tried code view for the cube but it doesn't appear to include the partition code.


Nick Ryan MIS Programmer Analyst, ANZ Bank

Processing new measure group and dimension to the existing cube in production

$
0
0

Hi ,

I am facing the below issue .

Consider I have 3 cubes( Cube A,cube B and Cube C) in a database in the production and it has quarterly partitions from 2012 till 2019. I have added 1 new Dimension and 1 measure group to the existing cube A. How do I deploy and process new dimension and Measure group for the existing cube A without overwriting Cube B and Cube c and all the partitions in the production?

Please help.

SSAS Cube Error - Dimension attributes not working in Excel

$
0
0

Hi Experts,

I have SSAS cube and designed an role based access security on cube. I have unchecked measures not required and filtered the user dimension based on user name from directory. For few dimensions, I need to hide attributes e.g: Demographics dimension - need to hide address, suburb and pincode for this particular role but user should be able to browse region/country/state/city attributes from the dimension. After Implementation, this works fine on SSMS cube browser but throws an permission/ member does not exist in Excel file.


Thanks,

Mithun

Trying Process Tabular 1400 AMO Powershell

$
0
0


Hello:

I am trying to process a Tabular 1400 with Powershell using TOM, my code is like:

add-type -path "C:\Program Files\Microsoft SQL Server\150\SDK\Assemblies\Microsoft.AnalysisServices.Tabular.DLL"
$server = New-Object microsoft.analysisservices.tabular.server
$server.connect("servername")
$server.Databases["TabularDB"]
$db = New-Object Microsoft.AnalysisServices.Tabular.Model
$db = $server.Databases["TabularDB"]
$db.Refresh()
$db.Process()

$db.Refresh(): doesn`t do anything.

$db.Process(): shows: This command cannot be executed on database 'TabularDB' because it has been defined with StorageEngineUsed set to TabularMetadata. For databases in this mode, you must use Tabular APIs to administer the database.


What do i wrong?

Thanks

Joining two SCD Type2 tables with 1:M relation with complex join & filter condition in SSAS Tabular model

$
0
0

Assuming, I have below two tables Department and Employee where I am storing data for different customers(tenants) and there’s one-to-many (1:M) relationship between these two tables (i.e. one department can have 1 or more employees)

However, let’s say both the tables are SCD Type 2 i.e. storing history with effective and termination dates. There are no constraints, indexes etc. created on these tables at database level.

Department table:
cust_id dept_id dept_name   efctv_dt    trmntn_dt   Dept_key
1001    D1      IT        12-01-2018    12-31-9999  1001D1
1001    D2      HR        01-01-2019    12-31-9999  1001D2
1002    D3      Admin     02-01-2019    02-28-2019  1002D3
1002    D3      HR+Admin  03-01-2019    12-31-9999  1002D3
1002    D4      Finance   02-01-2019    12-31-9999  1002D4

Employee table:
cust_id emp_id  emp_name    dept_id efctv_dt    trmntn_dt   Emp_key
1001    E1      XYZ          D1    01-01-2019   01-31-2019  1001D1
1001    E1      XYZ-A        D1    02-01-2019   12-31-9999  1001D1
1001    E2      ABC          D2    02-01-2019   12-31-9999  1001D2
1002    E3      AXBYCZ       D3    03-01-2019   03-31-2019  1002D3
1002    E3      AXBYCZ       D4    04-01-2019   12-31-9999  1002D4
1002    E4      DEFG         D4    04-01-2019   12-31-9999  1002D4

Columns cust_id & dept_id can be concatenated together as a separate column in both the tables as a key field and used as a join between both the tables.

Department Key=Concatenate(department[cust_id], department[dept_id] )

Employee Key=Concatenate(employee[cust_id], employee[dept_id] )

Example key output values= 1001D1, 1001D2, 1002D3, 1002D4

Now let’s say we have following reporting requirements, i.e.

To filter on Date Ranges (in visualization) - assuming there's another date dimension table with all dates & hierarchy

1) When no specific date range or filter selected - show all current active employee & departments names (where, trmntn_dt = 12-31-9999)
So, expected output is:

Emp Name Dept Name
XYZ-A IT
ABC HR
AXBYCZ Finance

2) When reporting for a specific month example - Jan-2019 - show all employees & department names active as of that month. So, expected output is:

Emp Name Dept Name
XYZ IT

3) When reporting for a specific Quarter example - Q1-2019 - show all employees & department names active as of that quarter. So, expected output is:

Emp Name Dept Name
XYZ-A IT
ABC HR
AXBYCZ HR+Admin

However, the join condition in AS Tabular model with 1:M relationship between these two tables would fail because the rows are not unique in the Department table (rows for D3), which is on the one side of the relationship.

If you include efctv_dt or trmntn_dt also in the concatenated join condition in both the tables as key for joining i.e.

Department Key=Concatenate(department[cust_id], department[dept_id] ) & Concatenate(department[efctv_dt],””))

Employee Key=Concatenate(employee[cust_id], employee[dept_id] ) & Concatenate(employee[efctv_dt],””))

Example key output values= 1001D112-01-2018, 1001D201-01-2019…

However, though now the rows would be unique since we don’t expect same row twice on the same day (unless some ETL issues like process ran twice on the same day etc.)

AS tabular model doesn’t allow to create complex join/condition (like in SAP BO Universe) so that we could add below condition when joining these two SCD type 2 tables as below which might help solve some of the requirements - something like below in the Where clause of the SQL:

    dept.cust_id = emp.cust_id
And dept.dept_id = emp.dept_id
And ( calendar_date is between efctv_dt and trmntn_dt 
        Or 
       trmntn_dt = ’12-31-9999’
    )

I think for creating/calculating any measure value is still doable with lots of examples available online on DAX to filter on the dates, but what about with just the dimensional attributes ?

Is this the right approach ? How to handle these? And, that too without using surrogate keys for generating unique values in each SCD type 2 tables and referencing it as FK/reference key from Parent->Child (1:M) i.e. Dept->Emp table.

Please suggest.

Thanks!

Viewing all 14337 articles
Browse latest View live