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

MDX Query Help Union Multiple Dimensions

$
0
0

I had asked a similar question in another post I created, but I've since got new requirements i'm having trouble with. 

I essentially need to add the rows in green to my dataset by editing the MDX below.


I got it to work if it's just 1 column but can't figure it out for more than 1. The 4 commented out columns break my query: 

WITH
  MEMBER [Divisional Sales Branch].[DivisionalSalesBranch].[All Branches] AS
    AGGREGATE (
		{
         (
		 // [Invoice Date].[Date].[All],
         // [Invoice Date].[Relative Date].[All],
          [Divisional Sales Branch].[DivisionalSalesBranch].[All]
		  )
        }
    )

SELECT
  NON EMPTY {
    [Measures].[Sales],
    [Measures].[GP Dollars],
    [Measures].[GP Pct]
  } ON COLUMNS,
  NON EMPTY
  UNION
  (
    {([Divisional Sales Branch].[DivisionalSalesBranch].[All Branches])},
      {
         (
		// [Invoice Date].[Date].[Date].allmembers *
        //  [Invoice Date].[Relative Date].[Relative Date].allmembers *
          [Divisional Sales Branch].[DivisionalSalesBranch].[DivisionalSalesBranch].allmembers
		  )
      }

) ON ROWS
FROM ( SELECT
       (
         {
           [Invoice Date].[Relative Date].&[Last Invoice Date]
         }
       ) ON COLUMNS
     FROM [Model]) 

Thank you for anyone that can help ! 



How to get the DDL to create the FACT table?

$
0
0

Hi,

My goal is to create a star schema (not cubes). All I have is:

-A staging database with all the raw tables (Not DIM and FACT) (MS SQL 2012)

-SSAS 2012

-A datamart database where I need to create FACT and DIM tables (MS SQL 2012)

I have started with identifying the relationships between the tables, understand the business requirement and create a star schema for each subject area/business requirement (Like Sales, Finance)

Once I create my dimension tables, how do I create the star schema?

Can I see the DDL for FACT tables after modelling? How do I create it in my database?

I am a beginner in Data Warehousing, any help or comments to correct my understanding are appreciated.

Thanks,

SQL_Learner2016



Multiple Source and Target Currency in Tabular Model

$
0
0

Hi All,

I have a Fact table which has Transactions in CAD and USD both the currencies. I have to make a "TargetCurrency" Measure which will give the result in CAD and USD both means it will convert Native value to CAD(Source CAD + converted source USD to CAD) and USD both.

Something like image below. I have a ExchangeRate table, FactTransaction Table , Currency source and Currency Target table.

Please help me with DAX and proper relationship of the tables.

Thanks,

Gaurav



Row Labels Actual Net Sales
Canadian Dollars27,102,422.59
United States Dollars20,767,662.24
Local (Native) Dollars25,362,730.29
Grand Total 25,362,730.29

Issue with parallel sales amount (calculated measure) due to CASE WHEN statement

$
0
0

Hi guys,

The following screenshot is an example from the cube :

The following code is used :

CASE

WHEN NOT [Date invoice].[Bonus Calendar - Week].CurrentMember IS [Date invoice].[Bonus Calendar - Week].[All]
    THEN

		 Sum(
		 NonEmpty(
		ParallelPeriod(
				[Date invoice].[Bonus calendar - Week].[Bonus year],
				1,
				[Date invoice].[Bonus calendar - Week].CurrentMember
			    )
				                ,[Measures].[Number of links])
		,
		[Measures].[Sales amount]
        )


WHEN NOT [Date invoice].[Invoice Calendar - Week].CurrentMember IS [Date invoice].[Invoice Calendar - Week].[All]
THEN

		Sum(
		NonEmpty(
		ParallelPeriod(
				[Date invoice].[Invoice calendar - Week].[Invoice year],
				1,
				[Date invoice].[Invoice calendar - Week].CurrentMember
			    )
				                ,[Measures].[Number of links])
		,
		[Measures].[Sales amount]
        )

ELSE NULL

END

The reason for the CASE is because I want to show the parallel sales amount, dependent on what calendar is used. In the first example I use the bonus calendar. The difference between the 2 calendars is that the weeks have a different date (logically).

Now, all this stuff works like a charm, but what I would like to do now is also chose multiple weeks in the filter!

As you can see it doesn't work. Could anyone help me adjusting or providing me a different calculated measure that works in both scenarios? Thanks!!

I know why it doesn't work, because the currentmember is not really one week but multiple weeks, but I can't find an alternative code.


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

Same Decimal Representation for Different Numbers

$
0
0

Hi,

I have two tables in my model with columns of data type decimal(30).

The decimal representation in the cube results in two different numbers getting the same decimal representation in the cube.

For example:

The decimal numbers 354915894366182032575657 and 354915894366182034022710 are both represented in the cube as 

3.54915894366182E+23 causing two different records to be considered as duplication.

Is there any way around it?

Thanks,
Udi

SSAS Processing the dimensions giving the unknown XML DOM Error

$
0
0

Hi All,

Happy New Year .

When we are doing the production cube processing we are getting the below error and unable to check , why this error is coming

"The DOM parser failed to load and parse the stream. URL:'' Reason: 'Illegal qualified name character. ' Source:''. File . Line: 1."

Please help on this 


Mahesh Alam

MDX for SSAS pivot table analysis: workday-adjusted revenue for current month last year

$
0
0

Dear all,

I do not have advanced MDX knowledge and am trying to create an MDX that adjusts the revenue for Current Month Today Last Year to the number of working days of the current month, current year.

The formula I need is: 

(Total revenue ([Measures].[Revenue]) of Current Month Last Year Today ([01 - Product].[By Product Brand].[Product Brand Corp])

/

Number of workdays ([Measures].[Workday Counter]) of Total Current Month ([83 - Grouping Time MAN].[By Time Group].[Time Group].&[71])

*

Number of workdays ([Measures].[Workday Counter]) of Current Month Today ([83 - Grouping Time MAN].[By Time Group].[Time Group].&[21])

This MDX should be integrated in pivot table reports that typically include the following measure and members:

[Measures].[Revenue] as measure

[83 - Grouping Time MAN].[By Time Group].[Time Group] as manual time member in columns

[01 - Product].[By Product Brand].[Product Brand Corp] or other members in rows

Does this make sense? Maybe there is an easier way than using an MDX?

Thank you in advance!

LXLX1209


Please need help SSAS>SSRS>SharePoint

$
0
0

Hi All,

i'm using SP 2013 Azure. I created a folder "Data Source" under Reports and it points to SSAS Cube and tested successfully , by checking the stored credentials and then checking "Use as Windows Crdentials". I deployed SSRS Reports and uploaded an Excel Report (which also points to the same cube). None of these work.

When i click on the SSRS Report i'm getting the following error 

An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Cannot impersonate user for data source 'NIPAC'. ---> Microsoft.ReportingServices.Diagnostics.Utilities.ClaimsToWindowsTokenException: Cannot convert claims identity to windows token. ---> System.InvalidOperationException: Could not retrieve a valid Windows identity. ---> System.ServiceModel.FaultException`1[[System.ServiceModel.ExceptionDetail, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]: WTS0003: The caller is not authorized to access the service. 

When i click on the excel report i'm getting the following error

We're sorry. We ran into a problem completing your request.

Please try that again in a few minutes.

 I have been searching online and couldn't find why these errors. Really SP is not user friendly to host reports using SSAS. 

Can someone please point me in the right direction?

Thanks

Setting UP OLAP

$
0
0

Hello All

I haved Set Up my IIS Server for analysis Services using this site: https://msdn.microsoft.com/en-us/library/gg492140.aspx.

I have used sql management studio for try connections. When i put https://www.mydomain.com/olap/msmdpump.dll, it opens the DW analysis databases.

My chief wants also to put https://bi.mydomain.com/olap/msmdpump.dll also working.

I have add in hosts file this info: IP x.x.x.x bi.mydomain.com, and when on Internet explorer write http/s://bi.mydomain.com it worked. But on management studio says:

 - The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. (System)

The remote certificate is invalid according to the validation procedure. (System)

Does anyone knows what i am missing here?

Thanks in advance


Not a legal OleAut Date - SSAS

$
0
0

Hi everybody,

I am trying import table to modular table Project in SSAS but i have problems
Not a legal OleAut Date
My table in source has 3 columns of type date and i saw that i have null value to one column date, this is a problem?
How for solve this problem?

Many to many scenario (Unit of measure conversion)

$
0
0

Hi

I have a Many to Many scenario I am converting MDX (SSAS) to DAX (Tabular2016) , and yes I know that we don't have scopes in tabular model, but I know that it can be handled with DAX….

I have a set of tables as mentioned

Relation

 1 ----------> 

n                        n

<--1      1 --->

n

Table name

DimUOMRelated

FctMeasureConversion

DimUOM

FctSale

Fields

UOFRelaed_id

UOFRelaed_id

UOF_id

UOF_id

UOF_id

PrimUnit

ConversionFactor

Measures

QtyUnitsPrim:= SUM([PrimUnit])

In MDX (SSAS) I have a scope that needs to be converted to DAX and its like

SCOPE([Measures].[Qty Units Related]);

SCOPE(Leaves([Unit of Measure]));

SCOPE(EXCEPT([DimUOMRelated].[UOM Related].[UOM Related].MEMBERS,

[DimUOMRelated].[UOM Related].[All]));

THIS = [Measures].[ QtyUnitsPrim] * [Measures].[Conversion Factor];

END SCOPE;

END SCOPE;

In excel Pivot table I will be using the DimUOMRelated , DimDate and a Measure from FctSales Only

How can I convert the above SCOPE to DAX in a new measure  [Qty Units Related]? I prefer not to change the design.

It’s very urgent we need help asap please, thanks

Sincerely

  Nik


Sincerely Nik -- Please kindly mark the post(s) that answered your question and/or vote for the post(s). http://sqldataside.blogspot.ca/ (SQL Tabular + PowerShell)


MDX for Averages

$
0
0

I am trying to come up with an average of appt count by day and hour.  The goal is to be able to traverse through my hierarchy of the calander and see on average how many appts are accommodated by hour.

I have a different Date and Time dimensions, I cannot figure out the mdx for this but optimally, I could put this as a cube calculation.

WITH MEMBER AvgAppt AS AVG([Measures].[ApptCount])
SELECT
		NON EMPTY (AvgAppt,
		([Times].[Hour12Long].CHILDREN
			*
		[ApptDate].[CalendarYear].CHILDREN
		)
	   ) ON COLUMNS
	   ,
	   [ApptDate].[DayName].CHILDREN
	   ON ROWS
FROM Appt

below is the result, but for example the AVG for Sunday 8 AM should equal 2.35; the result is actually the Total


KDW

Excel 2010 drilldown query too slow, how to troubleshoot?

$
0
0

When attempting to drill down into a particular dimension, it hits a certain point and then it takes forever for the query to return.

Looking at profiler I pulled out the following query:

SELECT

NON EMPTY Hierarchize(DrilldownMember({{DrilldownLevel({[Date].[Fiscal].[All]},,,INCLUDE_CALC_MEMBERS)}},

 {[Date].[Fiscal].[Fiscal Year].&[FY 15/16]},,,INCLUDE_CALC_MEMBERS))

 ON COLUMNS ,

 NON EMPTY
CrossJoin(Hierarchize({DrilldownLevel({[Entity Investor].[Identity].[All]},,,INCLUDE_CALC_MEMBERS)}),
 Hierarchize(DrilldownMember({{DrilldownMember({{DrilldownLevel({[Accounts].[Hierarchy].[All]},,,INCLUDE_CALC_MEMBERS)}},
 {[Accounts].[Hierarchy].[Fac Group].&[ISA]},,,INCLUDE_CALC_MEMBERS)}},
{[Accounts].[Hierarchy].[Faccode].&[IS]},,,INCLUDE_CALC_MEMBERS)))
 ON ROWS  FROM

 (SELECT

({[Date].[Fiscal].[Fiscal Year].&[FY 16/17], [Date].[Fiscal].[Fiscal Year].&[FY 15/16]}) ON COLUMNS ,

 ({[Entity Investor].[Identity].[Name].&[XXXX, XXX]&[ID1111]&[RL1111]}) ON ROWS

 FROM [Cube])

 WHERE ([Measures].[Total]) 

Its been narrowed down to a single person, so the number of items is negligible, in this case, the lowest grain of the period has a single date for each month, so 15 items.

The accounts user hierarchy is FacGroup (3) -> FacType -> Wrapperref

The hierarchy can be expanded until FacType with no issue. If I attempt to drill down on FacType it will grind to a halt.

In the above scenario, Each FacType above only has one WrapperRef child.

WrapperRef is the underlying key of the table, or rather the key is the underlying primary key, I renamed it to another user friendly name.

The accounts dimension has approx 550k rows.

I have tried : 

simplifying the user hierarchy, removed composite keys 

running the aggregation design again. 

Any help would be appreciated.

Thanks

jon

Error when converting Nvarchar to Float were Null exist in a column being converted(When Joining two table)

$
0
0

Good day all,

I am trying to join two table however my primary key , and foreign key have different data types  . kindly assist with syntax which can join the two table ,at the same time convert Nvarchar to float because that's were I am getting an error.

''Error occurred when converting Nvarchar to Float ''


I THINK THE PROBLEM IS BECAUSE THE OTHER COLUMN WITH NVATCHAR CONTAINS NULL , PLEASE ASSIST , I WOULD REALLY APPRECIATE.

MDX Rolling total for selected periods

$
0
0

Hi All

I have received a requirement to build a rolling total. I have found many articles articulating how you can sum for a period using periodstodate and so forth.

My requirements however is to do the rolling total only on selected period members.

Below is an example of the periods and what is required

Now for the measure. When hardcoding the "first" member the calculation works as advertised.

CREATE MEMBER CURRENTCUBE.[Measures].[Rolling Total]
AS SUM( ([Date].[Calendar].&[2015].&[12]
         :[Date].[Calendar].Currentmember)
      , [Measures].[Sales Amount])
, VISIBLE = 1  ; 


This however needs to change so that the "first" period member / Current member is automatically calculated.

Was thinking in the lines of:

CREATE MEMBER CURRENTCUBE.[Measures].[Rolling Total 2] AS
 SUM( ((
        strtomember(HEAD(
	[Date].Calendar].Currentmember.member_unique_name
	,1))
        ):[Date].[Calendar].Currentmember)
        , [Measures].[Sales Amount])
, VISIBLE = 1  ;


Please any suggestions are most welcome.

Jacques

         

Kerberos Authentication

$
0
0

Hi,

By putting SSAS and SharePoint on the same box , can we by pass Kerberos Authentication? I mean we are planning to move some of the excel reports that point to the cube onto a sharepoint site , but when  we did move a report , the report is not working and there is lot of complexity involved in granting kerberos authentication. Instead if we have them both on the same box will we be still having that issue ?

Thanks

Cube Design Tables

$
0
0

HI

Best practice table source for cube.

Option 1

Create dimension tables with distinct attributes from source, i.e distinct lookups, create fact tables and feed dimension tables off fact tables.

Option2

Create 1 wide deformalized table and create the different dimensions in the cube from the flat table or create distinct views based on the flat table and pull the views in as dimensions.


Error in SSAS log: Type: 3, Category: 289, Event ID: 0xC121000C

$
0
0

During the hourly process of reprocessing the cube sometimes we will the error log will spam the following error

An error occurred while writing a trace event to the rowset.  Type: 3, Category: 289, Event ID: 0xC121000C 

I've put profiler traces on during this reprocessing process and i cannot find any more information that would be relevant to this error code. Does anyone have an idea as to how to further troubleshoot this issue?


Measure values disappear in tabular models

$
0
0

The measure values in my tabular models will sometimes (randomly) disappear. I can still see the text of the measure and I can still query the values or access them by linking to the model in excel. I've tried re-processing the models, redoing the measures etc and nothing seems to work. Even when I add new measures and deploy the model I can access the value in other ways but it does not show in my model. I'm working with the following version of Microsoft Visual Studio 2013:

Microsoft Visual Studio 2013 Shell (Integrated)
Version 12.0.21005.1 REL
Microsoft .NET Framework
Version 4.6.01590

Installed Version: IDE Standard

SQL Server Analysis Services   
Microsoft SQL Server Analysis Services Designer 
Version 12.0.2000.8

SQL Server Integration Services   
Microsoft SQL Server Integration Services Designer
Version 12.0.2430.0

SQL Server Reporting Services   
Microsoft SQL Server Reporting Services Designers 
Version 12.0.2430.0

Viewing all 14337 articles
Browse latest View live


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