Showing posts with label appear. Show all posts
Showing posts with label appear. Show all posts

Sunday, March 25, 2012

Difference Between Comma Operator and Crossjoin?

I have two queries that appear to return the same result. Can someone explain how combining two dimensions with the comma operator differs from combining the same two dimensions using the crossjoin operator?

For example, two dimensions, account and sales. When I run this query with the cross join operator

select { [Measures].[Sales Count] } on columns,

{ ([Account].[Name].Allmembers *

[Date].[Month Val].[5] : [Date].[Month Val].Devil

) } on rows

from warehouse

it returns the same results as this query when using the comma operator to create the set:

select { [Measures].[Sales Count] } on columns,

{ ([Account].[Name].Allmembers ,

[Date].[Month Val].[5] : [Date].[Month Val].Devil

) } on rows

As crossjoin states, in example 1 above, every account is combined with every month value. When using the comma operator, I see the exact same results. Are these functionally equivalent? Any reason to use one method over the other?

Thanks....

AS2005 can be very forgiving - perhaps too forgiving - with MDX syntax...

First of all, despite appearances, there is no comma operator: the comma is used as a delimiter within a set and a tuple definition. Crossjoin you're ok with. What you're doing in your queries is producing a set of tuples containing every month crossjoined with every account and for the sake of clarity this is best written as an explicit crossjoin, either using the asterisk operator or the crossjoin function, something like this:

select { [Measures].[Sales Count] } on columns,
[Account].[Name].Allmembers * {[Date].[Month Val].[5] : [Date].[Month Val].Devil}
on rows
from warehouse

In your first query you're putting the above crossjoin operation inside a set of parentheses (), which denote a tuple - and which AS is ignoring because you're producing a set of tuples anyway. In the second query because you've put a set definition rather than a member as the second item in your tuple definition AS must be assuming that you want to do a crossjoin and is again returning the set of tuples you're after, but this behaviour is new to me and from a maintenance point of view should probably be avoided.

Chris

|||

Hi Chris,

I'm wondering whether the comma syntax in the 2nd example (which I also recall being mentioned in Teo Lachev's As 2005 book) is technically a subcube expression, as defined for the SCOPE script statement or a Cell Calculation:

http://msdn2.microsoft.com/en-us/library/ms145989.aspx

>>

Subcube_Expression ::= (Auxiliary_Subcube [, Auxiliary_Subcube,...n])

Auxiliary_Subcube ::=
Limited_Set
| Root([dimension_name])
| Leaves([dimension_name])

>>

Mosha had mentioned in his blog that a subcube could get converted to a set, under certain circumstances (though unsupported):

http://sqljunkies.com/WebLog/mosha/archive/2006/04/29/leaves.aspx

>>

How to work with Dimension Leaves

While Analysis Services may convert subcube returned by Leaves function to set (by choosing attribute hierarchies corresponding to the attributes), it is not supported usage.

>>

|||

Hmmm, possibly... In which case, if Mosha says it's unsupported, it's definitely to be avoided.

Chris

|||Agreed...crossjoin works fine. Thanks for the feedback.

Sunday, March 11, 2012

Diagrams disappearing in SQL 2000

We appear to have a problem with our diagrams in SQL 2000 Enterprise
manager - The diagrams either disappear so that when you click them there is
nothing to view or alternatively the tables show with no fields. This
problem doesn't affect all diagrams, but a large proportion of them.
Any ideas ?
Hi
Have you installed SP3a on the server AND the client machines that have
Enterprise Manager Installed.
I have seen this when the 2 are out of sync.
Regards
Mike
"Andy Reilly" wrote:

> We appear to have a problem with our diagrams in SQL 2000 Enterprise
> manager - The diagrams either disappear so that when you click them there is
> nothing to view or alternatively the tables show with no fields. This
> problem doesn't affect all diagrams, but a large proportion of them.
> Any ideas ?
>
>

Saturday, February 25, 2012

Developing a report with Reporting Services in SQL Express

Hi,

I'm trying to use reporting services in teh VS2003 but the Option to I create the project does not appear, i've already installed SP3 and no success, any idea ?

Thanks

Which reporting service? I don't believe SQL 2000 Reporting Services is supported on MSDE. You should probably be asking this question in a Visual Studio forum rather than a SQL forum.

Mike

|||

Ok, then

Thanks... And do you Know if SQL 2005 Express has this service ?

Thanks

|||

Yes, SQL Express with Advanced Services includes Reporting Services. The tool to create reports, BIDS, is available in the SQL Express Toolkit. Both can be downloaded from http://msdn.microsoft.com/vstudio/express/sql/download.

Regards,

Mike Wachal
SQL Express team

|||

Nice....

Another thing, I have an application that is currently using MSDE, I use some stored procedures and functions.... Is it all compatible with SQL Express 2005 do I need to change anything in my application ?

Thanks

|||

Hi, question regarding developing a report using SQL Express with advanced/reporting services. I have all packages installed correctly (I think) but am unable to start the BI report developer tool because the Start menu shortcut for the business intelligence development studio points to an executable that is not there. It points to: "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe"

FYI, I am running Windows XP SP2 and do not have Visual Studio installed, although I do have Visual C# Express installed. There is a VCSExpress.exe in that directory, if that helps.

I can access the web based links for the reporting services manager at http://localhost/Reports$SQLExpress with no problems.

Any idea on how to use the report developer tool?

Thanks,

Todd