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

Measure to get active count of Customers

$
0
0

Hello All,

My Greetings for the day!!!

I am trying to get distinct count of customers having flag=1.

Can you please suggest?

Following is the table structure



The expected output should be distinct count of active customer = 2 (i.e. 101, 103)

Regards,

Hiren Parikh


Hiren Parikh


Calculated members in cub file?

$
0
0

I am learning SSAS and cube files. I have an ssas application on SQL server 2012 and it works fine.  I use Visual Studio 2012 as development tool for SSAS. We use Excel 2013 to look into the data. I need to distribute an offline cube to some external users and I have produced an offline cube from Excel. But my offline cube does not include the calculated  members from SQL Server.

Am I doing something wrong or is this normal behaviour?

Can I use some other tool to produce offline cube file with calculated members?

Regards


Tore

Total Aggregation

$
0
0

First up, apologies for Title, I have no idea what to call my issue...

Based on the following example

Year 2015
   Month 1   10
   Month 2   12
   Month 3   15
...
   Month 12  34
Year 2016
   Month 1    8
   Month 2   13
   Month 3   25
...
   Month 11  66

I want a new measure which gives me the total for the last day of each year. So what I have attempted is to say remove all my date filters except for year and give me the last day in this new context but while the "ALLEXCEPT" part seems to work, when I add in the last date, it seems to re-apply the month filter and so I get the total for the last day of each  month rather than the same value across all rows in the year.

My measure is 

EOY:=CALCULATE(
	SUM ( Table[Amt]);
	FILTER(ALLEXCEPT('Date'; 'Date'[Calendar Year]);
      'Date'[Date_Key] = MAX('Date'[Date_Key])))

In the above example, I'd be looking to get 34 in all rows for 2015 and 66 in all rows for 2016

Any suggestions on where I'm going wrong and what I may try instead?

Thanks in advance


Update Statement via SystemOpenquery

$
0
0

Hi,

we have a lot of cubes from different departments. What we are testing now:

-) Each AS Database will have an Datasource to a LogTable, where the department can admin which AS Objects should be processed.

-) an UC4 Job will connect to the AS DB and select via SYSTEMOPENQUERY all objects to process.

-) now I would like to update the status in this logtable ALSO via SYSTEMOPENQUERY. Basically the Update statement works, but nevertheless I get an OLEDB - ODBC Error.

So my question, is it generally supported to execute Updates/Inserts via SYSTEMOPENQUERY?

Thanx

Kr Jürgen

Partition Processing Takes time

$
0
0

Hi Everyone,

I have a data source that has over 100 Million rows and i partitioned the table as well as the cube.

However, the the cube still takes 4-8hours to process.

Please I really need assistance on how to improve the process.

Thanks


me

Parent child hierarchy reset values

$
0
0

Hello everyone,

I have a task, where I could need some starting support.

I built a cube which aggregates the sales amount with a parent child hierarchy. I have nodes in that hierarchy which are two times in the hierarchy as you can see it in the pic (node 3). Of course the ID in the background is different.

Additional information to the task

  • The amount of node 3 included the childs of are every time the same
  • Depending on the value of node 3 I need to reset the value for node 3 and every child. if node 3 is greater or equal 0 it should be reset to 0 for path 1-2-3. If it is smaller then 0 I need to reset the path 5-3
  • In addition the reset amount should not be included into the parent levels (see the following pic)
  • As the amount and the localization depends on filter of the dimension attributes I need to do it in mdx.


    The following pic presents the case, that node 3 is greater or equal 0.


Looking forward to read from you!

Thanks Andy



How to install SSAS

$
0
0

Hi,

On my server i have 2014 SSMS and i can connect to the database engine and Integration services, the Analysis service is not shown under the local services running. When i tried to connect to SSAS using SSMS i'm getting the following error

TITLE: Connect to Server
------------------------------

Cannot connect to (local).

------------------------------
ADDITIONAL INFORMATION:

A connection cannot be made. Ensure that the server is running. (Microsoft.AnalysisServices.AdomdClient)

------------------------------

No connection could be made because the target machine actively refused it 127.0.0.1:2383 (System)

------------------------------
BUTTONS:

OK
------------------------------

Can someone please help me as how i can install SSAS or is there some configuration that i'm missing?

Is there something similar to Oracle Universal Installer?

Thanks

Average a sum

$
0
0

Hopefully I can explain this sufficiently ... we have a table with a set of scores for various tasks and for each person carrying out these tasks, we need to calculate an overall score with a max score from each category. Given the below

Person	Code	Score
1	a	10
1	a	12
1	a	4
1	b	3
1	c	2
1	c	5
2	a	8
2	b	16
2	b	6
2	c	12
2	c	3
3	b	3
3	b	5
3	c	2
3	c	7
4	a	2
4	a	3
4	b	4
4	b	2
4	c	5
4	c	1


What we have is for each person, they have three tasks. We want to sum up their score for each task to a max of 20 points giving a priority to task a then b then c. Once we've determined the categorisation we then apply a multiplier depending on the task (multiply by 4 for task a, 3 for task b and 2 for task c). This will give us the following results

Person	a (*4)	b (*3)	c (*2)	total
1	20	0	0	80
2	8	12	0	68
3	0	8	9	42
4	5	6	6	50

Once we've got each person's total, we want to get the average.

So in SSAS, we want for each person, sum up their a, b and c scores, determine how many points in each task actually applies (i.e. stop when we hit 20 points in total) and apply the multiplier. I have attempted to use 

First get score for each task

a Score:=MAXX(SUMMARIZE( 'Person';'Person'[id]); CALCULATE(sum([Score]); 'Score'[Task] = "a"))
b Score:=MAXX(SUMMARIZE( 'Person';'Person'[id]); CALCULATE(sum([Score]); 'Score'[Task] = "b"))
c Score:=MAXX(SUMMARIZE( 'Person';'Person'[id]); CALCULATE(sum([Score]); 'Score'[Task] = "c"))

then limit to 20 across the board

a20:=IF([a Score]>20; 20; [a Score])
b20:=IF([b Score]+[a20]>20; 20-[a20]; [b Score])
c20:=IF([c Score]+[b20]+[a20]>20; 20-[b20]-[a20]; [c Score])

and then calculate the average

ave:=AVERAGEX(SUMMARIZE( 'person' ;'person'[Id])
                       ;CALCULATE([a20]*4 + [b20]*3 + [c20]*2; ))

I know there are a few faults

 - I have no idea what to use instead of "MAXX" in the first set

 - I'm certain I'm causing a double loop by doing the summarize in both the first set and the average calculation but no other "average" function likes the calculation as its entry (something about needs to be a single column)

The output would appear to be selecting the max score for the group (80 in my above example) rather than calculating the average (60) which as my best guess is because the MAXX is determining the 80 score and passing that back to the average for every person.

If I don't put the summarize section for the score calculations, it appears to be adding up the relevant task for ALL people rather than only that task for the current subject person.

Any suggestions highly appreciated!


SSAS MDX Excel cumulative total dynamic date

$
0
0

I'm trying to create a calculated measure based on a simple business request. (cumulative connections total on date selected) so if they select 2016 for example it totals for the year up until now. If they select november 2016, it totals from beginning of november up until now. I have these two versions of code at the moment but they just select all dates/don't work... I'm a noob when it comes to MDX... I am using a standard sort of date dimension...

CREATE MEMBER CURRENTCUBE.[Measures].[Connection Run Rate] AS SUM({NULL:[Order Creation Date].CurrentMember}, [Measures].[Connection]), FORMAT_STRING = "#,##0;-#,##0", VISIBLE = 1 , ASSOCIATED_MEASURE_GROUP = 'Fact Order' ; CREATE MEMBER CURRENTCUBE.[Measures].[Connection Run Rate] AS Aggregate(PeriodsToDate([Order Creation Date].[Dates].[Month],[Order Creation Date].[Dates].[Month].CurrentMember), [Measures].[Connection]), FORMAT_STRING = "#,##0;-#,##0", VISIBLE = 1 , ASSOCIATED_MEASURE_GROUP = 'Fact Order' ;


create calculated name files in SSAS (YTD,QTD, MTD and WTD)

$
0
0

I want to create calculated name files in SSAS on mentioned below criteria can anyone guide me.

Year to Date (YTD)

Quarter to Date (QTD)

Month to Date (MTD)

Week to Date (WTD)

Measure

Sales-Qty

Sales-Cost

Sales-Retail

Dimension

Time

Date

Day of Year

Day of Quarter

Day of Month

Day of Week

Month Number

Month Name

Weak Number

Day Name

Quarter

Year


Abid Ali

Connection to SQL Server 2016 issue

$
0
0
I am using a trial version of SQL Server 2016 for a college course.  I've loaded it successfully, however, I cannot connect.  I receive error 26 - Network related or instance specifc error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.  Verify that the instance name is correct and that SQL Server is configured to allow remote connections (provider:  SQL Network Interfaces, error: 26 - Error locating Server/Instance Specifed) (Microsoft SQL Server)

MDX Query To Fetch Columns From Two Different Dimensions

$
0
0

Hi All,

I have below mention two dimension tables:

Country

Country Country_Description REGION_CODE
BEIBeijingASI
BOMMumbaiASI
HKGHong KongASI
SHAShanghaiASI
SINSingaporeASI
TOKTokyoASI


Product_Balance

Branch_Code Product_ID A-Balance B-Balance
BEI1031210056528.0756528.07
BEI122011001500015000
BOM1031210063356.4263356.42
BOM1120910014051.8220.98
BOM122011001178.721178.72
BOM16100000316.89316.89
BOM1256000048907.6248907.62
BOM10200000742.73742.73
BOM162000001474.931474.93
HK11252100193132.220
HK191761062500000
HK1917611116025.930
HK11166100823256.570
HK19176105962942.460


In SQL Reporting Services I am providing a drop down menu where I would like provide option to select Country (from Country) based on which report will provide balances (from Product_Balance table).

I want to write a MDX query to display "Country_Description" as Display Caption and pass "Branch_Code". Below is the query which I wrote but its giving cartisian product.


Howsoever I am looking for something like below

Not sure how to achieve this. Please suggest me a way.

Regards


Regards Gursethi Blog: http://gursethi.blogspot.com/ ++++ Please mark "Propose As Answer" if my answer helped ++++



Duplicate Attribute Key error

$
0
0

Heloo Gurus,

I created a dimension using VS 2012  and when i process it i'm getting the following errors and warnings

Server: The current operation was cancelled because another operation in the transaction failed.

Internal error: The operation terminated unsuccessfully.

Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of 'STG CUSTOMER ', Name of 'STG CUSTOMER' was being processed.

Errors in the OLAP storage engine: An error occurred while the 'CSST' attribute of the 'STG CUSTOMER' dimension from the 'TEST_CUBE' database was being processed.

Errors in the OLAP storage engine: A duplicate attribute key has been found when processing: Table: 'dbo_STG_CUSTOMER', Column: 'CSCITY', Value: ''. The attribute is 'CSCITY'.

can someone please tell me what the issue is?

The part i'm confused is when i remove NULL's in the data , the dimension is processed, but that wont suffice my needs as there are some fields that are NULLS that i need 

Thanks


Please need a work around or how to deal with the scenario

$
0
0

Hi All,

I'm designing a dimension and running into issues. The dimension is Plant dimension. The Plant delivers products to multiple locations. Please see the sample data

CREATE TABLE PLANT
(PLNTNO TINYINT,
SHIP_TO_NO SMALLINT,
STATE VARCHAR(3),
CITY VARCHAR(20)
);
INSERT INTO PLANT
VALUES
(3,2,Jindal,Muskegon,mi),(3,gycorp,grandhaven,mi),(3,labcorp,grandrapids,mi)

As you see the plant_no is the primary key and when i process the dimension i'm getting the duplicate attribute key error.

"Errors in the OLAP storage engine: A duplicate attribute key has been found when processing: Table: 'dbo_STG_SHIP_TO', Column: 'PLT_NO', Value: '3'. The attribute is 'PLT NO'.

How can i overcome this as there will be multiple dimensions with this kind of data, please need some suggestions.

Thanks


SV

Errors when using CROSSJOIN command against SQL Server 2008 R2 from MSOLAP.4 provider.

$
0
0

I am trying to run a query containing the CROSSJOIN command against a SSAS cube from the client-side application, and get the below error:

-2147467259: Microsoft OLE DB Provider for Analysis Services 2008 R2.: Internal error: An unexpected exception occurred.:0

The issue is isolated to queries using a CROSSJOIN between filtered sets and normal measures. Other queries run fine.

Also, the same CROSSJOIN query runs perfectly fine if I run it from SSMS instead.

The client is a legacy VB application. It creates a System.Data.OleDb.Connection object and uses the below connection string

Provider=MSOLAP.4;Integrated Security=SSPI;Data Source=<ServerName>\<InstanceName>

SSAS version is  SQL Server 2008 R2 SP3 (10.50.6000.34)

A similar issue was highlighted for SQL 2005 and SQL 2008 here. But its supposed to be fixed in SQL 2008 R2 SP3.

Any help would be appreciated.

Thanks!!



Azure SSAS failed deployment

$
0
0

I am trying to deploy a tabular model to Azure SSAS instance using SQL Server Express 2016 as a data source. I have on-premises data gateway installed and registered in Azure. I keep getting the following error message:

"Failed to save modifications to the server. Error returned: 'On-Premise Gateway is required to access the data source and the gateway is not installed for the server ...."

An empty database is created during the deployment process which can be accessed via Power BI, SSMS but it does not contain any data besides the schema itself.

What could be a possible reason for that? I am using windows authentication to access the SQL Server instance which is located on the same machine and the same credentials are used to login to Azure.

I would be very grateful for any hint.

Thank you very much in advance.


Sum of distinct counts

$
0
0

Hello,would it be possible to sum up the distinct values in the example below? "CountSalesAgentClean" is a "DistinctCount" measure. The correct total is 194 (distinct agents for the week). Now, business wants a new measure that sums up the distinct agents, that would be 511. Is this possible? Thanks a million!

Row Labels CountSalesAgentClean
1/3/2016 10
1/4/2016 56
1/5/2016 89
1/6/2016 108
1/7/2016 99
1/8/2016 97
1/9/2016 52
Grand Total 194   (511)


South Florida Business Intelligence Developer

SSAS OLAP Role Playing Dimension Names

$
0
0

Hello, 

I have a question about role playing dimension names. 

I understand that typically attribute names in role playing dimension are fixed e.g. the attribute name 'Date' will be the same across multiple dimensions using a single role playing dimension.

However, where my cube uses a role playing dimension the cube browser describes the attribute name as below:

Dimension - Ordered Date

Attribute Name - Ordered Date.Date

Attribute Name -  Ordered Date.Quarter

------

Dimension - Shipped Date

Attribute Name -Shipped Date.Date

Attribute Name -  Shipped Date.Quarter

.

Is there a setting I can apply so that when I browse the cube I just see following format:

Dimension - Ordered Date

Attribute Name - Date (...e.g. NOT Ordered Date.Date)

Attribute Name - Month  (...e.g. NOT Ordered Date.Month)

------

Dimension - Shipped Date

Attribute Name - Date

Attribute Name -  Quarter

Thanks! :)




Issue with SSAS tabular 2016 partitioning

$
0
0

When attempting to process a new partition added to a fully processed table we are receiving the following error.  

Error 0: 
Error 0: 
The JSON DDL request failed with the following error: Failed to execute XMLA. Error returned: 'Memory error: Allocation failure . If using a 32-bit version of the product, consider upgrading to the 64-bit version or increasing the amount of memory available on the machine.
Memory error: Allocation failure . If using a 32-bit version of the product, consider upgrading to the 64-bit version or increasing the amount of memory available on the machine.
'..

We have tracked memory usage and the server has over 200 GB free when this error occurs.  Also doing a full process on the table is successful where an automatic will fail (only the new partition needs processing).  So it seems to be directly related to adding a new partition to a already processed table and then attempting to process the newly added partition.

Is anyone else having this sort of issue?  

Few details

Table: 513,000,000+ rows across 178 partitions.

SSAS Version: 13.0.2149.0

Server: 2x16 hyperthreaded cores, 384GB, Windows Server 2012R2


Kenny Ruth

SSAS MDX Excel Monthly Run Rate

$
0
0

Hi I'm trying to create a calculated measure in a cube for a monthly run rate. How do you do this in MDX? The formula is measure/currentdayinmonth * total days in month so something like the below screenshot however I can't get it to work...

CREATE MEMBER CURRENTCUBE.[Measures].[Connection Run Rate]AS[Measures].[Connection]/([Order Creation Date].[Day Num Of Month].CurrentMember)* COUNT([Order Creation Date].[Day Num Of Month].[ALL]),
FORMAT_STRING ="#,##0.00;-#,##0.00",
VISIBLE =1,  ASSOCIATED_MEASURE_GROUP ='Fact Order';

Viewing all 14337 articles
Browse latest View live


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