Monday, March 12, 2012
MDX, dates and Calendar Control in Reporting services 2005
I need to develop several reports in RS 2005 where the report
parameters are dates. The reports are based on a SQL Server 2005
Analysis Services Cube and consequently the reports need to be based
on MDX. My dates are formatted according to Swedish date standard. I
would like the users to pick the dates from a Calendar control.
(I have seen several smilar problems with dates, but all referring to
SQ statements, not MDX)
Here's my problem:
When I design my query in the Data tab of the report, I choose the
field that I want to use as a parameter (in this case a date) and tick
the checkbox indicating that I want a Report parameter created.
When I inspect the report in Preview, the date is not displayed in a
calendar, but instead as a tremendously long list. (Not good!) When I
look at the report parameter in Layout it has the datatype String.
- If I change the parameter to DateTime (in order to get a calendar),
I get a runtime error: "an error occurred during local report
processing. The property 'Valid Values' of report paramater
'KalenderDatum' doesn't have the expected type."
My question:
- What can I do to make Reporting Services understand that I want to
display dates?
- Can calendar controls be used with MDX at all'
- Is there someting I need to do in MDX to format my date as a
DateTime field?
- Does RS just not like Swedish' ;-)
Additional info:
- My cube is built on a staging database, and if I design a report
against that database with ordinary SQL statements using the same
DateTime field, I get a calendar control, and RS understands that I
want to display dates. Everything works fine.
- I have set the language property on my report to Swedish (the date
format being yyyy-mm-dd)
Please let me know if there is a workaround for this. Unfortunately
MDX is not exactly my second language either...
CarinaI had the same problem (but with US date formats). What you need to do is on
the "Data" tab in your RS project, change the MDX query to an expression by
putting an = there followed by your whole MDX query in double quotes. Then
concantenate in your parameter date fields. Here is an example of how I did
it for a range on [Start Date] based on 2 datetime parameters called
Begin_Date and End_Date. Note, be sure there are no control characters or
carriage returns in your MDX expression.
="SELECT NON EMPTY { [Measures].[Login Count]} ON COLUMNS, NON EMPTY {
[GroupUsers].[Application - Name].[Login Name].ALLMEMBERS * [Date].[Start
Date].&[" & Format(Parameters!Begin_Date.Value,"MM/dd/yyyy") &
"]:[Date].[Start Date].&[" & Format(Parameters!End_Date.Value,"MM/dd/yyyy") &
"] } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM
[MyCubeDataset])) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR,
FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS"
I just set up regular Datetime report parameters for Begin_Date and End_Date
and added them to the dataset on the parameters tab. I formatted them into
the format I wanted inside the expression above because I needed the leading
zeroes for the date comparisons to work in MDX. Also, here is a link that
helped me:
http://msdn2.microsoft.com/en-us/library/aa902647(sql.80).aspx
Hope this helps.
"carina.jones@.sogeti.se" wrote:
> Hi,
> I need to develop several reports in RS 2005 where the report
> parameters are dates. The reports are based on a SQL Server 2005
> Analysis Services Cube and consequently the reports need to be based
> on MDX. My dates are formatted according to Swedish date standard. I
> would like the users to pick the dates from a Calendar control.
> (I have seen several smilar problems with dates, but all referring to
> SQ statements, not MDX)
> Here's my problem:
> When I design my query in the Data tab of the report, I choose the
> field that I want to use as a parameter (in this case a date) and tick
> the checkbox indicating that I want a Report parameter created.
> When I inspect the report in Preview, the date is not displayed in a
> calendar, but instead as a tremendously long list. (Not good!) When I
> look at the report parameter in Layout it has the datatype String.
> - If I change the parameter to DateTime (in order to get a calendar),
> I get a runtime error: "an error occurred during local report
> processing. The property 'Valid Values' of report paramater
> 'KalenderDatum' doesn't have the expected type."
> My question:
> - What can I do to make Reporting Services understand that I want to
> display dates?
> - Can calendar controls be used with MDX at all'
> - Is there someting I need to do in MDX to format my date as a
> DateTime field?
> - Does RS just not like Swedish' ;-)
> Additional info:
> - My cube is built on a staging database, and if I design a report
> against that database with ordinary SQL statements using the same
> DateTime field, I get a calendar control, and RS understands that I
> want to display dates. Everything works fine.
> - I have set the language property on my report to Swedish (the date
> format being yyyy-mm-dd)
>
> Please let me know if there is a workaround for this. Unfortunately
> MDX is not exactly my second language either...
> Carina
>|||Thank you so much for your input! With your help and the explanation
below I did figure it out :-). I'm a happy camper!
/Carina
In short (found this explanation on another site):
1. Develop the report.
2. Change the Data Type of the date parameters to DateTime, and set
Available Values to Non-queried.
3. On the Data tab, edit the cube's Dataset (click on the ... button).
4. Click on the Parameters tab of the Dataset dialog box. Replace the
Value of the date parameters with ="[Dimension].[Member].&[" +
Format(CDate(Parameters!ParameterName.Value), "yyyy-MM-ddT00:00:00") +
"]" where [Dimension].[Member] and ParameterName are the dimensions
and parameter names of your particular cube. Depending on how your
dimension is set up, you may also need to change the format of the
date.
5. There is no need to change the MDX of the query.
MDX statement using Parameters as Calendar
I'm developing reports using SQL2005 and Reporting Service 2005 where I'm
using MDX to extract the information from the cube, but now I need to get a
range of data as a parameter, but using the Calendar date picker from
Reporting server, do you know if is it possible ?
Thanks,
ElvisHi Elvis,
This issue was discussed a couple of months back (June CTP time-frame) in
the SQL Server 2005 Beta newsgroup, but unfortunately I can no longer locate
it. Anyway, what I recall is that I had to resort to using the old OLE DB for
OLAP Provider (which worked with MDX in RS 2000), because in that case the
MDX query is dynamically built as an expression; and the data type of date
parameters can then be set to DateTime, which will enable the Calendar date
picker. Of course, in that case, the expression has to transform the returned
date string to an appropriate MDX Date Dimension member name.
"elvispires" wrote:
> Hello People,
> I'm developing reports using SQL2005 and Reporting Service 2005 where I'm
> using MDX to extract the information from the cube, but now I need to get a
> range of data as a parameter, but using the Calendar date picker from
> Reporting server, do you know if is it possible ?
> Thanks,
> Elvis
>
>|||hi,
do you have an example of dynamically built mdx ? Becaus i also have that
problem.
with
member [month_list].[jan-sept] AS 'sum([month_list].[All
month_list].[January]:[Month_list].[All month_list].[September])'
the last [September] is supposed to be tha name of the current month
Thanks!
"Deepak" wrote:
> Hi Elvis,
> This issue was discussed a couple of months back (June CTP time-frame) in
> the SQL Server 2005 Beta newsgroup, but unfortunately I can no longer locate
> it. Anyway, what I recall is that I had to resort to using the old OLE DB for
> OLAP Provider (which worked with MDX in RS 2000), because in that case the
> MDX query is dynamically built as an expression; and the data type of date
> parameters can then be set to DateTime, which will enable the Calendar date
> picker. Of course, in that case, the expression has to transform the returned
> date string to an appropriate MDX Date Dimension member name.
> "elvispires" wrote:
> > Hello People,
> >
> > I'm developing reports using SQL2005 and Reporting Service 2005 where I'm
> > using MDX to extract the information from the cube, but now I need to get a
> > range of data as a parameter, but using the Calendar date picker from
> > Reporting server, do you know if is it possible ?
> >
> > Thanks,
> > Elvis
> >
> >
> >
> >
Friday, March 9, 2012
MDX Script: How do I create a YTD-Balance Measure?
Hi,
I am using the Standard Edition of SQL Server 2005. I have a financial reporting cube with the measure Amount and several dimensions (Time, Account, etc). A simplified version of the data is:
If I use the default cube then this is how data will show. What I would like to do is to add a YTD-Balance measure to the cube. This YTD-Balance measure would show the following data:
So instead of showing the difference in a month (eg 20) like the underlying data, I would like to show a running total for the year (eg 200+20=220). My attempt so far is:
Create Member CurrentCube.[Measures].[YTDBalance]
AS SUM({PeriodsToDate([Time].[(All)])}, [Measures].[Amount]),
NON_EMPTY_BEHAVIOR = { [Amount] },
VISIBLE = 1;
This doesn't do what I want however: it sums all months in a quarter, all quarters in a year, and all years in the cube. What I instead want is for each month to be a summary of the months in the year so far. Is anyone able to help me out at all with this?
Thanks, Matt
Assuming that there is a [Year] attribute in the [Time] dimension, whose type is "Years"; and that there is a [Time].[Calendar] hierarchy (as in the Adventure Works Date dimension), then you should be able to use the YTD() function:
Create Member CurrentCube.[Measures].[YTDBalance]
AS SUM(YTD([Time].[Calendar].CurrentMember), [Measures].[Amount]),
NON_EMPTY_BEHAVIOR = { [Measures].[Amount] },
VISIBLE = 1;
mdx reporting
examine the following piece :
with
member [month_list].[jan-sept] AS 'sum([month_list].[All
month_list].[January]:[Month_list].[All month_list].[September])'
As you can see, i summate the months January to September, september being
the current month. Now, is there a way to replace [September] with the month
that we are currently in, or perhaps by a parameter ?
Thanks in advanceKoen,
Here's an example of what I do...
MEMBER TIME_DIM.[YTD 2004] AS 'SUM([TIME_DIM].[2004].[Qtr
1].[1]:[TIME_DIM].[2004].[Qtr " & Datepart("q",Dateadd("m",-1,Now())) & "].["
& Month(Dateadd("m",-1,Now())) & "])'
... I do this to get data up to the previous month. I include the Qtr
because that is how my dimensions are set up. You may have to use the
Monthname function to return the full month name to match your dimension
structure.
"Koen" wrote:
> hi all,
> examine the following piece :
> with
> member [month_list].[jan-sept] AS 'sum([month_list].[All
> month_list].[January]:[Month_list].[All month_list].[September])'
>
> As you can see, i summate the months January to September, september being
> the current month. Now, is there a way to replace [September] with the month
> that we are currently in, or perhaps by a parameter ?
> Thanks in advance|||hi,
first of all, thanks for your (quick) reply.
i tried your suggestion, and i fabricated something like this :
member [month_list].[jan-sept] AS 'sum([month_list].[All
month_list].[January]:[Month_list].[All month_list].[" &
datename(month,getdate()) & "])'
but it says : Cannot find dimension member ("Month_list]. ...
perhaps there's a bad quote or something ? maybe you see it..
Thanks,
"williamericnichols" wrote:
> Koen,
> Here's an example of what I do...
> MEMBER TIME_DIM.[YTD 2004] AS 'SUM([TIME_DIM].[2004].[Qtr
> 1].[1]:[TIME_DIM].[2004].[Qtr " & Datepart("q",Dateadd("m",-1,Now())) & "].["
> & Month(Dateadd("m",-1,Now())) & "])'
> ... I do this to get data up to the previous month. I include the Qtr
> because that is how my dimensions are set up. You may have to use the
> Monthname function to return the full month name to match your dimension
> structure.
>
> "Koen" wrote:
> > hi all,
> >
> > examine the following piece :
> >
> > with
> >
> > member [month_list].[jan-sept] AS 'sum([month_list].[All
> > month_list].[January]:[Month_list].[All month_list].[September])'
> >
> >
> > As you can see, i summate the months January to September, september being
> > the current month. Now, is there a way to replace [September] with the month
> > that we are currently in, or perhaps by a parameter ?
> >
> > Thanks in advance|||Koen,
I'm assuming you are using 2000 RS and the query builder. It sucks and I
can't wait to try out 2005 mdx builder. So with that assumption... when you
build dynamic mdx statements you must surround it in quotes insert an "=" at
the beginning.
So my full mdx statement is this...
="WITH
MEMBER TIME_DIM.[SAMEAS 2003] AS 'SUM([TIME_DIM].[2003].[Qtr
1].[1]:[TIME_DIM].[2003].[Qtr " & Datepart("q",Dateadd("m",-1,Now())) & "].["
& Month(Dateadd("m",-1,Now())) & "])'
MEMBER TIME_DIM.[YTD 2004] AS 'SUM([TIME_DIM].[2004].[Qtr
1].[1]:[TIME_DIM].[2004].[Qtr " & Datepart("q",Dateadd("m",-1,Now())) & "].["
& Month(Dateadd("m",-1,Now())) & "])'
SELECT
{ TIME_DIM.[YTD 2004], TIME_DIM.[SAMEAS 2003], [TIME_DIM].[Yr].[2004],
[TIME_DIM].[Yr].[2003], [TIME_DIM].[Yr].[2002]} ON Axis(0),
NonEmptyCrossJoin([" &
Left(Parameters!Cat_1.Value,Instr(Parameters!Cat_1.Value,"|")-1) &
"].Levels(1).members, [" &
Left(Parameters!Cat_2.Value,Instr(Parameters!Cat_2.Value,"|")-1) &
"].Levels(1).members, [" &
Left(Parameters!Cat_3.Value,Instr(Parameters!Cat_3.Value,"|")-1) &
"].Levels(1).members, [" &
Left(Parameters!Cat_4.Value,Instr(Parameters!Cat_4.Value,"|")-1) &
"].Levels(1).members) ON Axis(1)
FROM [IICASE_COUNTS]
WHERE ([Measures].[Rec Count])"
... WARNING! Once you change it to a dynamic statement, the RS field list
will NOT update itself if you add\change fields. So if you need to
add/change fields, you must change it back to a static...refresh the fields
and then change it back to dynamic. I usually keep an extra copy of the
report with the static statement so I can go back and forth during debugging.
Hope this helps good luck.
"Koen" wrote:
> hi,
> first of all, thanks for your (quick) reply.
> i tried your suggestion, and i fabricated something like this :
> member [month_list].[jan-sept] AS 'sum([month_list].[All
> month_list].[January]:[Month_list].[All month_list].[" &
> datename(month,getdate()) & "])'
> but it says : Cannot find dimension member ("Month_list]. ...
> perhaps there's a bad quote or something ? maybe you see it..
>
> Thanks,
> "williamericnichols" wrote:
> > Koen,
> >
> > Here's an example of what I do...
> >
> > MEMBER TIME_DIM.[YTD 2004] AS 'SUM([TIME_DIM].[2004].[Qtr
> > 1].[1]:[TIME_DIM].[2004].[Qtr " & Datepart("q",Dateadd("m",-1,Now())) & "].["
> > & Month(Dateadd("m",-1,Now())) & "])'
> >
> > ... I do this to get data up to the previous month. I include the Qtr
> > because that is how my dimensions are set up. You may have to use the
> > Monthname function to return the full month name to match your dimension
> > structure.
> >
> >
> > "Koen" wrote:
> >
> > > hi all,
> > >
> > > examine the following piece :
> > >
> > > with
> > >
> > > member [month_list].[jan-sept] AS 'sum([month_list].[All
> > > month_list].[January]:[Month_list].[All month_list].[September])'
> > >
> > >
> > > As you can see, i summate the months January to September, september being
> > > the current month. Now, is there a way to replace [September] with the month
> > > that we are currently in, or perhaps by a parameter ?
> > >
> > > Thanks in advance
Wednesday, March 7, 2012
MDX Query Tool Problem
Tool against AdventureWorksDW on SQL 2005 sp1, Standard Edition (I am not
fluent in MDX). No matter what dimensions I drag on, the only output I can
get is a single cell / report services field.
For example, if I drag on the geography.country dimension and Sales
Order.Order Count measure, I just get a count of all orders.
--
simonI have found some sample MDX code for AdventureWorks that does work with the
Report Builder. Clearly I need to get more proficient with writing good
queries.
--
simon
"simon p" wrote:
> I am trying to get to grips with cube reporting and am running the MDX Query
> Tool against AdventureWorksDW on SQL 2005 sp1, Standard Edition (I am not
> fluent in MDX). No matter what dimensions I drag on, the only output I can
> get is a single cell / report services field.
> For example, if I drag on the geography.country dimension and Sales
> Order.Order Count measure, I just get a count of all orders.
> --
> simon
MDx Query Parameters
I'm trying to use mdx query in reporting services with a parameters.
But I am getting an error telling me my token is invalid my query
string is this:
SELECT NON EMPTY { [Measures].[Executions] } ON COLUMNS, NON EMPTY
{ Members("[Dates].[All Dates].[" + @.Year + "]." + "[June]") }
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM
[Procedure Completions] CELL PROPERTIES VALUE
I've declared Year right now I am just using the default value of 2007
but I keep on getting this error:
Formula error - syntax error - token is not valid: "{ Members("[Dates].
[All Dates].[" + ^@.^Year+"]." + "[June]") }" (urn:schemas-microsoft-
com:xml-analysis)
Any ideas of what I could be doing wrong?Try using the following:
{ Members(STRTOSET("[Dates].[All Dates].[" + @.Year + "]." + "[June]"),
CONSTRAINED) }
Although if I were doing it I would do it like this.
{Members(STRTOSET(@.Dateparameter,CONSTRAINED))} and then do the string
manipulation in the parameters section of the data set properties. The DS
properties are the "..." next to the name of the DS. You can use VB to
create an expression in there. This way you can use the query builder to
create your MDX for you.
Hope this helps,
Al
<RMurjani85@.gmail.com> wrote in message
news:1185475682.673977.86900@.g4g2000hsf.googlegroups.com...
> Hi,
> I'm trying to use mdx query in reporting services with a parameters.
> But I am getting an error telling me my token is invalid my query
> string is this:
> SELECT NON EMPTY { [Measures].[Executions] } ON COLUMNS, NON EMPTY
> { Members("[Dates].[All Dates].[" + @.Year + "]." + "[June]") }
> DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM
> [Procedure Completions] CELL PROPERTIES VALUE
> I've declared Year right now I am just using the default value of 2007
> but I keep on getting this error:
> Formula error - syntax error - token is not valid: "{ Members("[Dates].
> [All Dates].[" + ^@.^Year+"]." + "[June]") }" (urn:schemas-microsoft-
> com:xml-analysis)
> Any ideas of what I could be doing wrong?
>
MDX query for an Histogram
Hi All,
Trying to plot an Histogram chart in Reporting services using the data source as a cube. Currently the cube doesnt retrives the intervals from the cube for which the count is 0. I need the chart to show all the intervals everytime even when the count for that particular interval is 0.
Has anyone created any such chart? or can any one please help me with the correct MDX query for it.
Awaiting a response.
Regards,
Sumeet
The Non empty thing doesnt works, already tried with that. The query used in the Data source view is as follows:-
Case when Earned_Value <> 0 or Earned_Value <> null then
Case when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) < -0.50 then
'Less than -50%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between -0.50 and -0.41 then
'-41% to -50%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between -0.40and -0.31 then
'-31% to -40%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between -0.30 and -0.21 then
'-21% to -30%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between -0.20 and -0.11 then
'-11% to -20%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between -0.10 and -0.01 then
'-1% to -10%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) = 0 then
'0%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between 0.01 and 0.10 then
'1% to 10%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between 0.11 and 0.20 then
'11% to 20%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between 0.21 and 0.30 then
'21% to 30%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between 0.31 and 0.40 then
'31% to 40%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between 0.41 and 0.50 then
'41% to 50%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) > 0.50 then
'Above 50%'
end
end
The above query excludes the intervals itself for which their is not a value and thus no zero value is assigned to that interval as the interval itself doesnot exists. So actually the above query itself should be modified so that zero value can be assigned to the intervals for which no value is present.
Do anyone have an idea how this can be done?
Regards,
Sumeet
|||
I'm not sure if this will help or not, you have swapped from talking about an MDX query against the cube to wanting to change a named view in the DSV. But if all you want to do is to assign the records with 0 or no Earned_Value some sort of label, then adding the lines in red below should fix this.
Case when Earned_Value <> 0 or Earned_Value <> null then
Case when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) < -0.50 then
'Less than -50%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between -0.50 and -0.41 then
'-41% to -50%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between -0.40and -0.31 then
'-31% to -40%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between -0.30 and -0.21 then
'-21% to -30%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between -0.20 and -0.11 then
'-11% to -20%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between -0.10 and -0.01 then
'-1% to -10%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) = 0 then
'0%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between 0.01 and 0.10 then
'1% to 10%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between 0.11 and 0.20 then
'11% to 20%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between 0.21 and 0.30 then
'21% to 30%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between 0.31 and 0.40 then
'31% to 40%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) between 0.41 and 0.50 then
'41% to 50%'
when CAST((Earned_Value - Actual_Cost)/Earned_Value AS decimal(8,2)) > 0.50 then
'Above 50%'
end
else
'no value'
end
Saturday, February 25, 2012
MDX Query Filters
Hi,
I am creating report using reporting service and datasource is SQL Server 2005 Cube.
I am using query builder and i am creating query parameters in the query builder but when i run the report is showing the filters but data is not filtering based on which i selected from the list.
How do i create filters? Please help out on this.
Thanks
Switch to MDX mode and see the underlying query. There should be a subselect filter in the WHERE clause.|||
Thanks,
Now i am able to see the subqueries in MDX, but i am getting error when select the 'select all' from the list the following error message getting.
"An error occured during local report processing. Query execution failed for data set 'Dataset1' Query (1,461) The restrictions imposed by the CONSTRAINED flag in the STRTOSET function were violated.
Please help on this.
Thanks
|||
The CONSTRAINED flag requires the selected member name to be resolved to a qualified member name. Drop a textbox on your report and set it to expression:
=Join(Parameters!<parameter name>.Value,", ")
Run the report. Does the output looks like valid member names?
MDX Query designer working correctly?
I can build a report using the wizzard, preview it, deploy it, and all is good with the world. But if I so much as click on the Data tab in the report designer, the report becomes invalid.
Is this by design, or is there some other way to edit a report created with the MDX query designer?
Regards,
Clayton
This is known issue in Report Designer.
Here is workaround:
1. After the report wizard completes, close the report.
2. Open the report in code view
3. Edit the report removing all carriage returns and all whitespace (blanks) between the two tags
<rd:MdxQuery> and <QueryDefinition>
4. Save the report and close the window
5. Open the report in Design Mode.
MDX query designer behaving correctly in Reporting Services?
I can build a report using the wizzard, preview it, deploy it, and all is good with the world. But if I so much as click on the Data tab in the report designer, the report becomes invalid.
Is this by design, or is there some other way to edit a report created with the MDX query designer?
Regards,
Clayton
This is apparently a known problem. I posted this to the Reporting Services forum as well and recieved an answer there. Heres the link:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=171034&SiteID=1
Regards,
Clayton
MDX queries from Reporting Services
It seems it is the MDX that Reporting Services is very inefficient compared to that generated by Cube Analysis. It uses Selects in the From clause to restrict the scope of the query using the Filter parameters. Is this something anyone has come across, and are there any suggestions to get round it? I did try to paste the Cube Analysis MDX into Reporting Services but the parser rejected it as invalid.
I attach the comparitive MDX below for reference
Cube Analysis
SELECT NON EMPTY{Hierarchize({CROSSJOIN({CROSSJOIN({{{[Portfolio].[Benchmark Portfolio].[All],[Portfolio].[Benchmark Portfolio].[All].children} + {{[Portfolio].[Benchmark Portfolio].[Benchmark].&[1].children}}}},{{[Scenario].[Scenario].&[1],[Scenario].[Scenario].&[1].children} + {[Scenario].[Scenario].&[3],[Scenario].[Scenario].&[3].children} + {[Scenario].[Scenario].[Benchmark],[Scenario].[Scenario].[Benchmark].children} + {[Scenario].[Scenario].[Variance to Benchmark],[Scenario].[Scenario].[Variance to Benchmark].children}})},{{[Measures].[Duration]} + {[Measures].[Weighting]}})})} on 0, NON EMPTY{Hierarchize({{[Sector].[Sector Category].[All],[Sector].[Sector Category].[All].children}})} on 1 from [MIQB27] where ([Period].[Year- Month].[Month].&[2006-03-01T00:00:00],[Benchmark].[Benchmark].&[1],[Rating].[Rating Category].[All],[Currency of Exposure].[Currency].&[2]) CELL PROPERTIES VALUE, FORMATTED_VALUE, FONT_NAME, FONT_SIZE, FONT_FLAGS,FORE_COLOR, BACK_COLOR, FORMAT_STRING
Reporting Services
SELECT NON EMPTY { [Measures].[Duration], [Measures].[Weighting] } ON COLUMNS, NON EMPTY { ([Sector].[Sector Category].[Sector Category].ALLMEMBERS * [Benchmark].[Benchmark].[Benchmark].ALLMEMBERS * [Portfolio].[Portfolio].[Portfolio].ALLMEMBERS * [Scenario].[Scenario].[Scenario].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( { [Scenario].[Scenario].&[1] } ) ON COLUMNS FROM ( SELECT ( { [Rating].[Rating Category].&[38] } ) ON COLUMNS FROM ( SELECT ( { [Benchmark].[Benchmark].&[1] } ) ON COLUMNS FROM ( SELECT ( { [Period].[Year- Month].[Month].&[2006-03-01T00:00:00] } ) ON COLUMNS FROM [MIQB27])))) WHERE ( [Period].[Year- Month].[Month].&[2006-03-01T00:00:00], [Rating].[Rating Category].&[38] ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
It's hard to say without seeing your cube, but I suspect one reason for the difference is the fact that RS forces you to pivot your queries so that you only have the measures dimension on columns. This means that you have to put all the rest of your dimensions crossjoined on rows, which could potentially mean that the NON EMPTY operation has a lot of tuples to work on. How many members are there in the Sector Category, Benchmark, Portfolio and Scenario attributes?
Does changing the MDX in RS to be something like the following make a difference?
SELECT NON EMPTY { [Measures].[Duration], [Measures].[Weighting] } ON COLUMNS,
NON EMPTY { (
NONEMPTY(
[Sector].[Sector Category].[Sector Category].ALLMEMBERS
, { [Measures].[Duration], [Measures].[Weighting] })
* [Benchmark].[Benchmark].[Benchmark].ALLMEMBERS * [Portfolio].[Portfolio].[Portfolio].ALLMEMBERS *
[Scenario].[Scenario].[Scenario].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM
( SELECT ( { [Scenario].[Scenario].&[1] } ) ON COLUMNS FROM ( SELECT ( { [Rating].[Rating Category].&[38] } ) ON COLUMNS FROM ( SELECT ( { [Benchmark].[Benchmark].&[1] } ) ON COLUMNS FROM ( SELECT ( { [Period].[Year- Month].[Month].&[2006-03-01T00:00:00] } ) ON COLUMNS FROM [MIQB27])))) WHERE ( [Period].[Year- Month].[Month].&[2006-03-01T00:00:00], [Rating].[Rating Category].&[38] ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
Chris
|||I have changed the cube slightly - I had one dimension called Benchmark which I removed it only has 3 leaf members and the ALL level. I had the Benchmark code on another dimension as an attribute so I thought I would use this instead. The RS query now worlks very quickly. On the face of it the MDX query looks just as complex (see below). The only thing I canm think of is as Benchmark was an attribute of Portfolio and a dimension in its own right, it might have been doing some Cartesian Product. But even so there were only 3 members.Anyway, I am glad the issue has gone away - I was beginning to get worried about the use of RS on top of AS.
Regards
Paul
SELECT NON EMPTY { [Measures].[Weighting], [Measures].[Duration] } ON COLUMNS, NON EMPTY { ([Rating].[Rating Category].[Rating Category].ALLMEMBERS * [Sector].[Sector Category].[Sector Category].ALLMEMBERS * [Portfolio].[Benchmark Portfolio].[Portfolio].ALLMEMBERS * [Scenario].[Scenario].[Scenario].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( STRTOSET(@.CurrencyofExposureCurrency, CONSTRAINED) ) ON COLUMNS FROM ( SELECT ( { [Scenario].[Scenario].&[1], [Scenario].[Scenario].&[3] } ) ON COLUMNS FROM ( SELECT ( STRTOSET(@.PortfolioBenchmark, CONSTRAINED) ) ON COLUMNS FROM ( SELECT ( STRTOSET(@.PeriodYearMonth, CONSTRAINED) ) ON COLUMNS FROM [MIQB28])))) WHERE ( IIF( STRTOSET(@.PeriodYearMonth, CONSTRAINED).Count = 1, STRTOSET(@.PeriodYearMonth, CONSTRAINED), [Period].[Year- Month].currentmember ), IIF( STRTOSET(@.PortfolioBenchmark, CONSTRAINED).Count = 1, STRTOSET(@.PortfolioBenchmark, CONSTRAINED), [Portfolio].[Benchmark].currentmember ), IIF( STRTOSET(@.CurrencyofExposureCurrency, CONSTRAINED).Count = 1, STRTOSET(@.CurrencyofExposureCurrency, CONSTRAINED), [Currency of Exposure].[Currency].currentmember ) ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
|||
I am curious about your table structure. It looks like you are trying to do the same thing I am. Comparing portfolios to benchmarks for various groupings. Are weightings a calculated field? Do you have an overweight/underweight calculation? Do you use a PortfolioBenchmark dimension table or break them out?
Thanks for any help.
MDX queries from Reporting Services
Services off Analysis Services, in that the reports take a very long
time and I have to often kill the queries. They are using 100%CPU. I have then replicated as
closely as possible the report using the Cube Analysis add in for
Excel, and the response is almost instantaneous.
It
seems it is the MDX that Reporting Services is very inefficient
compared to that generated by Cube Analysis. It uses Selects in the From clause to restrict the scope of the query using the Filter parameters. Is this something anyone has come across, and are there any suggestions to get round it? I did try
to paste the Cube Analysis MDX into Reporting Services but the parser
rejected it as invalid.
I attach the comparitive MDX below for reference
Cube Analysis
SELECT
NON EMPTY{Hierarchize({CROSSJOIN({CROSSJOIN({{{[Portfolio].[Benchmark
Portfolio].[All],[Portfolio].[Benchmark Portfolio].[All].children} +
{{[Portfolio].[Benchmark
Portfolio].[Benchmark].&[1].children}}}},{{[Scenario].[Scenario].&[1],[Scenario].[Scenario].&[1].children}
+
{[Scenario].[Scenario].&[3],[Scenario].[Scenario].&[3].children}
+
{[Scenario].[Scenario].[Benchmark],[Scenario].[Scenario].[Benchmark].children}
+ {[Scenario].[Scenario].[Variance to
Benchmark],[Scenario].[Scenario].[Variance to
Benchmark].children}})},{{[Measures].[Duration]} +
{[Measures].[Weighting]}})})} on 0, NON
EMPTY{Hierarchize({{[Sector].[Sector Category].[All],[Sector].[Sector
Category].[All].children}})} on 1 from [MIQB27] where
([Period].[Year-
Month].[Month].&[2006-03-01T00:00:00],[Benchmark].[Benchmark].&[1],[Rating].[Rating
Category].[All],[Currency of Exposure].[Currency].&[2]) CELL
PROPERTIES VALUE, FORMATTED_VALUE, FONT_NAME, FONT_SIZE,
FONT_FLAGS,FORE_COLOR, BACK_COLOR, FORMAT_STRING
Reporting Services
SELECT NON EMPTY
{ [Measures].[Duration], [Measures].[Weighting] } ON
COLUMNS, NON EMPTY { ([Sector].[Sector Category].[Sector
Category].ALLMEMBERS *
[Benchmark].[Benchmark].[Benchmark].ALLMEMBERS
* [Portfolio].[Portfolio].[Portfolio].ALLMEMBERS
* [Scenario].[Scenario].[Scenario].ALLMEMBERS
) } DIMENSION PROPERTIES
MEMBER_CAPTION, MEMBER_UNIQUE_NAME
ON ROWS FROM ( SELECT ( {
[Scenario].[Scenario].&[1] } ) ON COLUMNS FROM ( SELECT ( { [Rating].[Rating Category].&[38] } ) ON COLUMNS FROM ( SELECT ( {
[Benchmark].[Benchmark].&[1] } ) ON COLUMNS FROM ( SELECT ( { [Period].[Year-
Month].[Month].&[2006-03-01T00:00:00] } ) ON
COLUMNS FROM
[MIQB27])))) WHERE ( [Period].[Year-
Month].[Month].&[2006-03-01T00:00:00], [Rating].[Rating Category].&[38]
) CELL PROPERTIES
VALUE, BACK_COLOR,
FORE_COLOR, FORMATTED_VALUE,
FORMAT_STRING, FONT_NAME,
FONT_SIZE, FONT_FLAGS
It's hard to say without seeing your cube, but I suspect one reason for the difference is the fact that RS forces you to pivot your queries so that you only have the measures dimension on columns. This means that you have to put all the rest of your dimensions crossjoined on rows, which could potentially mean that the NON EMPTY operation has a lot of tuples to work on. How many members are there in the Sector Category, Benchmark, Portfolio and Scenario attributes?
Does changing the MDX in RS to be something like the following make a difference?
SELECT NON EMPTY { [Measures].[Duration], [Measures].[Weighting] } ON COLUMNS,
NON EMPTY { (
NONEMPTY(
[Sector].[Sector Category].[Sector Category].ALLMEMBERS
, { [Measures].[Duration], [Measures].[Weighting] })
* [Benchmark].[Benchmark].[Benchmark].ALLMEMBERS * [Portfolio].[Portfolio].[Portfolio].ALLMEMBERS *
[Scenario].[Scenario].[Scenario].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM
( SELECT ( { [Scenario].[Scenario].&[1] } ) ON COLUMNS FROM ( SELECT ( { [Rating].[Rating Category].&[38] } ) ON COLUMNS FROM ( SELECT ( { [Benchmark].[Benchmark].&[1] } ) ON COLUMNS FROM ( SELECT ( { [Period].[Year- Month].[Month].&[2006-03-01T00:00:00] } ) ON COLUMNS FROM [MIQB27])))) WHERE ( [Period].[Year- Month].[Month].&[2006-03-01T00:00:00], [Rating].[Rating Category].&[38] ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
Chris
|||I have changed the cube slightly - I had one dimension called Benchmarkwhich I removed it only has 3 leaf members and the ALL level. I had
the Benchmark code on another dimension as an attribute so I thought I
would use this instead. The RS query now worlks very quickly. On the
face of it the MDX query looks just as complex (see below). The only
thing I canm think of is as Benchmark was an attribute of Portfolio and
a dimension in its own right, it might have been doing some Cartesian
Product. But even so there were only 3 members.
Anyway, I am glad the issue has gone away - I was beginning to get worried about the use of RS on top of AS.
Regards
Paul
SELECT NON EMPTY
{ [Measures].[Weighting], [Measures].[Duration] } ON
COLUMNS, NON EMPTY { ([Rating].[Rating Category].[Rating
Category].ALLMEMBERS * [Sector].[Sector
Category].[Sector Category].ALLMEMBERS *
[Portfolio].[Benchmark Portfolio].[Portfolio].ALLMEMBERS
* [Scenario].[Scenario].[Scenario].ALLMEMBERS
) } DIMENSION PROPERTIES
MEMBER_CAPTION, MEMBER_UNIQUE_NAME
ON ROWS FROM ( SELECT ( STRTOSET(@.CurrencyofExposureCurrency, CONSTRAINED) ) ON COLUMNS FROM ( SELECT ( { [Scenario].[Scenario].&[1],
[Scenario].[Scenario].&[3] } ) ON COLUMNS FROM ( SELECT ( STRTOSET(@.PortfolioBenchmark,
CONSTRAINED) ) ON
COLUMNS FROM ( SELECT ( STRTOSET(@.PeriodYearMonth,
CONSTRAINED) ) ON
COLUMNS FROM
[MIQB28])))) WHERE ( IIF(
STRTOSET(@.PeriodYearMonth, CONSTRAINED).Count =
1, STRTOSET(@.PeriodYearMonth, CONSTRAINED), [Period].[Year- Month].currentmember ), IIF(
STRTOSET(@.PortfolioBenchmark, CONSTRAINED).Count =
1, STRTOSET(@.PortfolioBenchmark, CONSTRAINED), [Portfolio].[Benchmark].currentmember ), IIF(
STRTOSET(@.CurrencyofExposureCurrency, CONSTRAINED).Count =
1, STRTOSET(@.CurrencyofExposureCurrency, CONSTRAINED), [Currency of Exposure].[Currency].currentmember ) ) CELL
PROPERTIES VALUE,
BACK_COLOR, FORE_COLOR,
FORMATTED_VALUE, FORMAT_STRING,
FONT_NAME, FONT_SIZE,
FONT_FLAGS
|||I am curious about your table structure. It looks like you are trying to do the same thing I am. Comparing portfolios to benchmarks for various groupings. Are weightings a calculated field? Do you have an overweight/underweight calculation? Do you use a PortfolioBenchmark dimension table or break them out?
Thanks for any help.
MDX parameters in Reporting Services 2005
I've been trying to create a report using a dataset filled with a MDX query.
That query needs to have parameters (they come from report parameters). I've
done everything, including what is described in msdn2 and still cant get it
to work.
(The problem is not with the query, if i substitute the @.vars with strings
it works!)
Has everyone ever done this?
Thx.You should use the filter area in the Analysis Services query designer and
check the parameter checkbox. The MDX query will contain:
STRTOSET(@.variablename, CONSTRAINED)
And your parameters will need to be member unique names. The MSDN article
might be for SQL 2000 RS and therefore outdated.
--
Brian Welcker
Group Program Manager
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Fernando Marçal" <FernandoMaral@.discussions.microsoft.com> wrote in message
news:9E0D1946-C659-4FE2-A862-2005743BCFD8@.microsoft.com...
> Hello,
> I've been trying to create a report using a dataset filled with a MDX
> query.
> That query needs to have parameters (they come from report parameters).
> I've
> done everything, including what is described in msdn2 and still cant get
> it
> to work.
> (The problem is not with the query, if i substitute the @.vars with strings
> it works!)
> Has everyone ever done this?
> Thx.|||Hello Brian,
Im not using query designer, i am creating my own query.
Below I provide my previous query and the query with the change you
sugested. It still doensn't work... it gives the following error:
"Parser: The syntax for '=' is incorrect. (Microsoft SQL Server 2005
Analysis Services)"
The query im using is this:
WITH MEMBER [Measures].[Visitas Previstas]
AS '[Measures].[OBJECTIVE]'
SELECT
{[Measures].[Visitas],
[Measures].[Visitas Previstas],
[Measures].[% Real],
[Measures].[% Por Potencial],
[Measures].[% nos VH e H]}
on columns,
{[TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[NACIONAL],
[TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[VERY HIGH],
[TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[HIGH],
[TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[MEDIUM],
[TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[LOW],
[TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[NO POTENTIAL]}
on rows
FROM TEAMS
WHERE CROSSJOIN([TEAMS DIM LINE].[LINE DESC].[@.lines1],
[TEAMS DIM PRODUCT].[PRODUCT DESC].[@.products1],
[TEAMS DIM BRICK].[TEAMS DIM BRICK].[ALL].[@.bricks1])
The query with changes:
WITH MEMBER [Measures].[Visitas Previstas]
AS '[Measures].[OBJECTIVE]'
SELECT
{[Measures].[Visitas],
[Measures].[Visitas Previstas],
[Measures].[% Real],
[Measures].[% Por Potencial],
[Measures].[% nos VH e H]}
on columns,
{[TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[NACIONAL],
[TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[VERY HIGH],
[TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[HIGH],
[TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[MEDIUM],
[TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[LOW],
[TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[NO POTENTIAL]}
on rows
FROM TEAMS
WHERE CROSSJOIN(strtoset(@.lines1,CONSTRAINED),
strtoset(@.products1,CONSTRAINED),
strtoset(@.bricks1,CONSTRAINED))
Thanks for the help... I really need to get this to work...
"Brian Welcker [MSFT]" wrote:
> You should use the filter area in the Analysis Services query designer and
> check the parameter checkbox. The MDX query will contain:
> STRTOSET(@.variablename, CONSTRAINED)
> And your parameters will need to be member unique names. The MSDN article
> might be for SQL 2000 RS and therefore outdated.
> --
> Brian Welcker
> Group Program Manager
> Microsoft SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Fernando Marçal" <FernandoMaral@.discussions.microsoft.com> wrote in message
> news:9E0D1946-C659-4FE2-A862-2005743BCFD8@.microsoft.com...
> > Hello,
> >
> > I've been trying to create a report using a dataset filled with a MDX
> > query.
> > That query needs to have parameters (they come from report parameters).
> > I've
> > done everything, including what is described in msdn2 and still cant get
> > it
> > to work.
> > (The problem is not with the query, if i substitute the @.vars with strings
> > it works!)
> >
> > Has everyone ever done this?
> >
> > Thx.
>
>|||Sorry, forgot to mencion that i must use report parameters (I have cascading
parameters that i must use in the MDX query).
I've defined this parameters before defining the MDX query, and now i want
to use them in the query.
Thanks again.
"Fernando Marçal" wrote:
> Hello Brian,
> Im not using query designer, i am creating my own query.
> Below I provide my previous query and the query with the change you
> sugested. It still doensn't work... it gives the following error:
> "Parser: The syntax for '=' is incorrect. (Microsoft SQL Server 2005
> Analysis Services)"
> The query im using is this:
> WITH MEMBER [Measures].[Visitas Previstas]
> AS '[Measures].[OBJECTIVE]'
> SELECT
> {[Measures].[Visitas],
> [Measures].[Visitas Previstas],
> [Measures].[% Real],
> [Measures].[% Por Potencial],
> [Measures].[% nos VH e H]}
> on columns,
> {[TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[NACIONAL],
> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[VERY HIGH],
> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[HIGH],
> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[MEDIUM],
> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[LOW],
> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[NO POTENTIAL]}
> on rows
> FROM TEAMS
> WHERE CROSSJOIN([TEAMS DIM LINE].[LINE DESC].[@.lines1],
> [TEAMS DIM PRODUCT].[PRODUCT DESC].[@.products1],
> [TEAMS DIM BRICK].[TEAMS DIM BRICK].[ALL].[@.bricks1])
> The query with changes:
> WITH MEMBER [Measures].[Visitas Previstas]
> AS '[Measures].[OBJECTIVE]'
> SELECT
> {[Measures].[Visitas],
> [Measures].[Visitas Previstas],
> [Measures].[% Real],
> [Measures].[% Por Potencial],
> [Measures].[% nos VH e H]}
> on columns,
> {[TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[NACIONAL],
> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[VERY HIGH],
> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[HIGH],
> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[MEDIUM],
> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[LOW],
> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[NO POTENTIAL]}
> on rows
> FROM TEAMS
> WHERE CROSSJOIN(strtoset(@.lines1,CONSTRAINED),
> strtoset(@.products1,CONSTRAINED),
> strtoset(@.bricks1,CONSTRAINED))
> Thanks for the help... I really need to get this to work...
>
> "Brian Welcker [MSFT]" wrote:
> > You should use the filter area in the Analysis Services query designer and
> > check the parameter checkbox. The MDX query will contain:
> >
> > STRTOSET(@.variablename, CONSTRAINED)
> >
> > And your parameters will need to be member unique names. The MSDN article
> > might be for SQL 2000 RS and therefore outdated.
> >
> > --
> > Brian Welcker
> > Group Program Manager
> > Microsoft SQL Server Reporting Services
> >
> > This posting is provided "AS IS" with no warranties, and confers no rights.
> >
> > "Fernando Marçal" <FernandoMaral@.discussions.microsoft.com> wrote in message
> > news:9E0D1946-C659-4FE2-A862-2005743BCFD8@.microsoft.com...
> > > Hello,
> > >
> > > I've been trying to create a report using a dataset filled with a MDX
> > > query.
> > > That query needs to have parameters (they come from report parameters).
> > > I've
> > > done everything, including what is described in msdn2 and still cant get
> > > it
> > > to work.
> > > (The problem is not with the query, if i substitute the @.vars with strings
> > > it works!)
> > >
> > > Has everyone ever done this?
> > >
> > > Thx.
> >
> >
> >|||Why do you have an = sign in your query? Don't use an expression for your
query, just type the literal MDX in the MDX window. Ignore the SQL 2000 RS
directions - I would first build the query with the query designer and then
you can hand edit the generated MDX.
--
Brian Welcker
Group Program Manager
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Fernando Marçal" <FernandoMaral@.discussions.microsoft.com> wrote in message
news:E2AFD1FD-8909-4028-AC86-3592CCCE69C6@.microsoft.com...
> Sorry, forgot to mencion that i must use report parameters (I have
> cascading
> parameters that i must use in the MDX query).
> I've defined this parameters before defining the MDX query, and now i want
> to use them in the query.
> Thanks again.
> "Fernando Marçal" wrote:
>> Hello Brian,
>> Im not using query designer, i am creating my own query.
>> Below I provide my previous query and the query with the change you
>> sugested. It still doensn't work... it gives the following error:
>> "Parser: The syntax for '=' is incorrect. (Microsoft SQL Server 2005
>> Analysis Services)"
>> The query im using is this:
>> WITH MEMBER [Measures].[Visitas Previstas]
>> AS '[Measures].[OBJECTIVE]'
>> SELECT
>> {[Measures].[Visitas],
>> [Measures].[Visitas Previstas],
>> [Measures].[% Real],
>> [Measures].[% Por Potencial],
>> [Measures].[% nos VH e H]}
>> on columns,
>> {[TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[NACIONAL],
>> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[VERY HIGH],
>> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[HIGH],
>> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[MEDIUM],
>> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[LOW],
>> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[NO POTENTIAL]}
>> on rows
>> FROM TEAMS
>> WHERE CROSSJOIN([TEAMS DIM LINE].[LINE DESC].[@.lines1],
>> [TEAMS DIM PRODUCT].[PRODUCT DESC].[@.products1],
>> [TEAMS DIM BRICK].[TEAMS DIM BRICK].[ALL].[@.bricks1])
>> The query with changes:
>> WITH MEMBER [Measures].[Visitas Previstas]
>> AS '[Measures].[OBJECTIVE]'
>> SELECT
>> {[Measures].[Visitas],
>> [Measures].[Visitas Previstas],
>> [Measures].[% Real],
>> [Measures].[% Por Potencial],
>> [Measures].[% nos VH e H]}
>> on columns,
>> {[TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[NACIONAL],
>> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[VERY HIGH],
>> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[HIGH],
>> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[MEDIUM],
>> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[LOW],
>> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[NO POTENTIAL]}
>> on rows
>> FROM TEAMS
>> WHERE CROSSJOIN(strtoset(@.lines1,CONSTRAINED),
>> strtoset(@.products1,CONSTRAINED),
>> strtoset(@.bricks1,CONSTRAINED))
>> Thanks for the help... I really need to get this to work...
>>
>> "Brian Welcker [MSFT]" wrote:
>> > You should use the filter area in the Analysis Services query designer
>> > and
>> > check the parameter checkbox. The MDX query will contain:
>> >
>> > STRTOSET(@.variablename, CONSTRAINED)
>> >
>> > And your parameters will need to be member unique names. The MSDN
>> > article
>> > might be for SQL 2000 RS and therefore outdated.
>> >
>> > --
>> > Brian Welcker
>> > Group Program Manager
>> > Microsoft SQL Server Reporting Services
>> >
>> > This posting is provided "AS IS" with no warranties, and confers no
>> > rights.
>> >
>> > "Fernando Marçal" <FernandoMaral@.discussions.microsoft.com> wrote in
>> > message
>> > news:9E0D1946-C659-4FE2-A862-2005743BCFD8@.microsoft.com...
>> > > Hello,
>> > >
>> > > I've been trying to create a report using a dataset filled with a MDX
>> > > query.
>> > > That query needs to have parameters (they come from report
>> > > parameters).
>> > > I've
>> > > done everything, including what is described in msdn2 and still cant
>> > > get
>> > > it
>> > > to work.
>> > > (The problem is not with the query, if i substitute the @.vars with
>> > > strings
>> > > it works!)
>> > >
>> > > Has everyone ever done this?
>> > >
>> > > Thx.
>> >
>> >
>> >|||editing is the problem. I cant change anything in the query, it always gives
the error "An MDX expression was expected. An empty expression was found"
invariably!
PS: The = sign didnt come from the query but from the parameters I was
referencing in the query parameters window.
"Brian Welcker [MSFT]" wrote:
> Why do you have an = sign in your query? Don't use an expression for your
> query, just type the literal MDX in the MDX window. Ignore the SQL 2000 RS
> directions - I would first build the query with the query designer and then
> you can hand edit the generated MDX.
> --
> Brian Welcker
> Group Program Manager
> Microsoft SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Fernando Marçal" <FernandoMaral@.discussions.microsoft.com> wrote in message
> news:E2AFD1FD-8909-4028-AC86-3592CCCE69C6@.microsoft.com...
> > Sorry, forgot to mencion that i must use report parameters (I have
> > cascading
> > parameters that i must use in the MDX query).
> >
> > I've defined this parameters before defining the MDX query, and now i want
> > to use them in the query.
> >
> > Thanks again.
> >
> > "Fernando Marçal" wrote:
> >
> >> Hello Brian,
> >>
> >> Im not using query designer, i am creating my own query.
> >>
> >> Below I provide my previous query and the query with the change you
> >> sugested. It still doensn't work... it gives the following error:
> >>
> >> "Parser: The syntax for '=' is incorrect. (Microsoft SQL Server 2005
> >> Analysis Services)"
> >>
> >> The query im using is this:
> >>
> >> WITH MEMBER [Measures].[Visitas Previstas]
> >> AS '[Measures].[OBJECTIVE]'
> >> SELECT
> >> {[Measures].[Visitas],
> >> [Measures].[Visitas Previstas],
> >> [Measures].[% Real],
> >> [Measures].[% Por Potencial],
> >> [Measures].[% nos VH e H]}
> >> on columns,
> >> {[TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[NACIONAL],
> >> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[VERY HIGH],
> >> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[HIGH],
> >> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[MEDIUM],
> >> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[LOW],
> >> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[NO POTENTIAL]}
> >> on rows
> >> FROM TEAMS
> >> WHERE CROSSJOIN([TEAMS DIM LINE].[LINE DESC].[@.lines1],
> >> [TEAMS DIM PRODUCT].[PRODUCT DESC].[@.products1],
> >> [TEAMS DIM BRICK].[TEAMS DIM BRICK].[ALL].[@.bricks1])
> >>
> >> The query with changes:
> >>
> >> WITH MEMBER [Measures].[Visitas Previstas]
> >> AS '[Measures].[OBJECTIVE]'
> >> SELECT
> >> {[Measures].[Visitas],
> >> [Measures].[Visitas Previstas],
> >> [Measures].[% Real],
> >> [Measures].[% Por Potencial],
> >> [Measures].[% nos VH e H]}
> >> on columns,
> >> {[TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[NACIONAL],
> >> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[VERY HIGH],
> >> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[HIGH],
> >> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[MEDIUM],
> >> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[LOW],
> >> [TEAMS DIM POTENTIAL].[POTENTIAL DESC].[ALL].[NO POTENTIAL]}
> >> on rows
> >> FROM TEAMS
> >> WHERE CROSSJOIN(strtoset(@.lines1,CONSTRAINED),
> >> strtoset(@.products1,CONSTRAINED),
> >> strtoset(@.bricks1,CONSTRAINED))
> >>
> >> Thanks for the help... I really need to get this to work...
> >>
> >>
> >>
> >> "Brian Welcker [MSFT]" wrote:
> >>
> >> > You should use the filter area in the Analysis Services query designer
> >> > and
> >> > check the parameter checkbox. The MDX query will contain:
> >> >
> >> > STRTOSET(@.variablename, CONSTRAINED)
> >> >
> >> > And your parameters will need to be member unique names. The MSDN
> >> > article
> >> > might be for SQL 2000 RS and therefore outdated.
> >> >
> >> > --
> >> > Brian Welcker
> >> > Group Program Manager
> >> > Microsoft SQL Server Reporting Services
> >> >
> >> > This posting is provided "AS IS" with no warranties, and confers no
> >> > rights.
> >> >
> >> > "Fernando Marçal" <FernandoMaral@.discussions.microsoft.com> wrote in
> >> > message
> >> > news:9E0D1946-C659-4FE2-A862-2005743BCFD8@.microsoft.com...
> >> > > Hello,
> >> > >
> >> > > I've been trying to create a report using a dataset filled with a MDX
> >> > > query.
> >> > > That query needs to have parameters (they come from report
> >> > > parameters).
> >> > > I've
> >> > > done everything, including what is described in msdn2 and still cant
> >> > > get
> >> > > it
> >> > > to work.
> >> > > (The problem is not with the query, if i substitute the @.vars with
> >> > > strings
> >> > > it works!)
> >> > >
> >> > > Has everyone ever done this?
> >> > >
> >> > > Thx.
> >> >
> >> >
> >> >
>
>
Monday, February 20, 2012
MDX Parameter query
Services.
I have a parameter called FromParam in the report and I want to use the
following
MDX Query for the parameter:
select {[Period].[Period].Members} on rows , {} on columns from
Timesheet
All I want is a list of periods on rows I do not want anything on
columns please help me when I run this query I get a message:
Unable to display opened cellset. Cells cannot be created for this
cellset because one of the axes contains no positions.
All I want is a one axis query.
Thanks
Karenselect {[Period].[Period].Members} on axis(0)
from [Timesheet]
"KarenM" <karenmiddleol@.yahoo.com> wrote in message
news:1158930431.269312.221390@.e3g2000cwe.googlegroups.com...
>I have a Timesheet cube and I am reporting against it in Reporting
> Services.
> I have a parameter called FromParam in the report and I want to use the
> following
> MDX Query for the parameter:
> select {[Period].[Period].Members} on rows , {} on columns from
> Timesheet
> All I want is a list of periods on rows I do not want anything on
> columns please help me when I run this query I get a message:
> Unable to display opened cellset. Cells cannot be created for this
> cellset because one of the axes contains no positions.
> All I want is a one axis query.
> Thanks
> Karen
>
mdx parameter problem to get a smaller dataset
The first one gives a global overview and with a drillthrough link, you
get the second report for more details. The second report is getting
back the whole dataset out of our dwh and is giving an
outofmemoryexception.
I'm trying to reduce the dataset with the parameters from the first
report, but I get always some errors.
Below you can find my mdx-query. When I'm using hard coded values it's
working, but when I'm using the parameters then the preview of my
report gives some nasty erros:
"Report item expressions can only refer to fields within the current
data set scope or, if inside an aggregate, the specified data set
scope."
my report parameters:
GrootboekGrootboekNR
BoekjaarTeller
my mdx-query:
SELECT NON EMPTY { [Measures].[BUDGET BEDRAG BM], [Measures].[GROOTBOEK
BEDRAG BASIS MUNT] } ON COLUMNS, NON EMPTY {
([Boekperiode].[BoekPeriode].[BoekPeriode].ALLMEMBERS *
[Grootboek].[Grootboek_naam].[Grootboek_naam].ALLMEMBERS *
[Kostensoort].[Kostensoort_NR].[Kostensoort_NR].ALLMEMBERS *
[Kostensoort].[Kostensoort_naam].[Kostensoort_naam].ALLMEMBERS *
[Document_datum].[ddate].[ddate].ALLMEMBERS *
[DagboekCode].[DagboekCode].[DagboekCode].ALLMEMBERS *
[Organisatie].[Lid NR].[Lid NR].ALLMEMBERS * [Grootboek Rekening
Courant].[Grootboek Rekening Courant].[Grootboek Rekening
Courant].ALLMEMBERS * [Grootboek Rekening Courant].[Rekening Courant
Naam].[Rekening Courant Naam].ALLMEMBERS * [fd Grootboek Transactie
Omschrijving].[Grootboek Transactie Omschrijving].[Grootboek Transactie
Omschrijving].ALLMEMBERS * [fd Grootboek Document NR].[Grootboek
Document NR].[Grootboek Document NR].ALLMEMBERS ) } DIMENSION
PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( {
[BoekjaarTeller].[BoekjaarTeller].&[5] } ) ON COLUMNS FROM ( SELECT ( {
[Grootboek].[Grootboek_GR1].&[6], [Grootboek].[Grootboek_GR1].&[7] } )
ON COLUMNS FROM ( SELECT ( { [Organisatie].[Lid NR].&[ACCO] } ) ON
COLUMNS FROM [AcertFin]))) WHERE
([Grootboek].[Grootboek_GR1].CurrentMember,
[Grootboek].[Grootboek_NR].[Grootboek_NR].[" +
parameters!GrootboekGrootboekNR.Label +"],
[BoekjaarTeller].[BoekjaarTeller].[BoekjaarTeller].["+parameters!BoekjaarTeller.Label+"])
I've read also that you've to use ="..." to get a mdx expression, but
when I try that I'm getting errors about the =-sign.When it comes do dynamic queries, everything needs to be on the same line,
no extra lines are allowed. My best tip is to take the whole statement, put
it into Notepad, and turn off Word Wrap. Then make the whole query into a
very long line (it might break at some point, but try getting it all on one
line.)
If you need quotes inside the query, you need to escape them. Add another
quote in front and one behind, I think. (Properties("Key") will have to be
Properties("""Key""") I think.)
Some strings are casesensitive, so make sure you type Parameters with a big
P and also the parameter names.
I prefer using & instead of + when it comes to adding string values, but I'm
not sure if that has anything to say.
Make sure you have a space between " and & (or +), sometimes it gets funny
if you write it without spaces.
[BoekjaarTeller].[BoekjaarTeller].[BoekjaarTeller].["+parameters!BoekjaarTeller.Label+"]"
should be [BoekjaarTeller].[BoekjaarTeller].[BoekjaarTeller].[" &
Parameters!BoekjaarTeller.Label & "]
Also, check what the output of the Parameters!YourParameter.Label is. If it
sends out the wrong string, the query will fail.
How do you trigger the second report? URL? Again, check what the paramters
are in the link. Not sure if subreports uses the "drop down" parameters of
the main report, or if they use the parameter output from the hyperlink. If
your subreport query expects "1001" and gets "(1001) My book", your query
will fail. (I've had that problem, a link in a main report returned a
different member property than I expected.)
Kaisa
herman" <herman.maes@.gmail.com> wrote in message
news:1136364042.661254.230140@.f14g2000cwb.googlegroups.com...
> We have 2 reports in reporting services 2005.
> The first one gives a global overview and with a drillthrough link, you
> get the second report for more details. The second report is getting
> back the whole dataset out of our dwh and is giving an
> outofmemoryexception.
> I'm trying to reduce the dataset with the parameters from the first
> report, but I get always some errors.
> Below you can find my mdx-query. When I'm using hard coded values it's
> working, but when I'm using the parameters then the preview of my
> report gives some nasty erros:
> "Report item expressions can only refer to fields within the current
> data set scope or, if inside an aggregate, the specified data set
> scope."
> my report parameters:
> GrootboekGrootboekNR
> BoekjaarTeller
> my mdx-query:
> SELECT NON EMPTY { [Measures].[BUDGET BEDRAG BM], [Measures].[GROOTBOEK
> BEDRAG BASIS MUNT] } ON COLUMNS, NON EMPTY {
> ([Boekperiode].[BoekPeriode].[BoekPeriode].ALLMEMBERS *
> [Grootboek].[Grootboek_naam].[Grootboek_naam].ALLMEMBERS *
> [Kostensoort].[Kostensoort_NR].[Kostensoort_NR].ALLMEMBERS *
> [Kostensoort].[Kostensoort_naam].[Kostensoort_naam].ALLMEMBERS *
> [Document_datum].[ddate].[ddate].ALLMEMBERS *
> [DagboekCode].[DagboekCode].[DagboekCode].ALLMEMBERS *
> [Organisatie].[Lid NR].[Lid NR].ALLMEMBERS * [Grootboek Rekening
> Courant].[Grootboek Rekening Courant].[Grootboek Rekening
> Courant].ALLMEMBERS * [Grootboek Rekening Courant].[Rekening Courant
> Naam].[Rekening Courant Naam].ALLMEMBERS * [fd Grootboek Transactie
> Omschrijving].[Grootboek Transactie Omschrijving].[Grootboek Transactie
> Omschrijving].ALLMEMBERS * [fd Grootboek Document NR].[Grootboek
> Document NR].[Grootboek Document NR].ALLMEMBERS ) } DIMENSION
> PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( {
> [BoekjaarTeller].[BoekjaarTeller].&[5] } ) ON COLUMNS FROM ( SELECT ( {
> [Grootboek].[Grootboek_GR1].&[6], [Grootboek].[Grootboek_GR1].&[7] } )
> ON COLUMNS FROM ( SELECT ( { [Organisatie].[Lid NR].&[ACCO] } ) ON
> COLUMNS FROM [AcertFin]))) WHERE
> ([Grootboek].[Grootboek_GR1].CurrentMember,
> [Grootboek].[Grootboek_NR].[Grootboek_NR].[" +
> parameters!GrootboekGrootboekNR.Label +"],
> [BoekjaarTeller].[BoekjaarTeller].[BoekjaarTeller].["+parameters!BoekjaarTeller.Label+"])
> I've read also that you've to use ="..." to get a mdx expression, but
> when I try that I'm getting errors about the =-sign.
>
MDX MTD Calculation for Given Day In Month
I'm trying to get a MTD calculation up to a given day in a month for current and previous months. This is for a Reporting Services report. The columns will be Total Calls and Total Calls Through {X} Days in Month. The rows will just have the months listed. I was able to do this in RS 2000 using the following dynamic mdx statement:
= "WITH MEMBER [Measures].[ParallelPeriod] AS " +
" 'Sum({[TimesDaily.Calendar].CurrentMember.[1]:[TimesDaily.Calendar].CurrentMember.[" & Now.Day.ToString() & "]}, " + " [Measures].[Calls])' " +
" SET Months AS " +
" 'LastPeriods(" + CStr(Parameters!monthsback.value) + " , Tail({[TimesDaily.Calendar].Monthname.Members}, 1).item(0))' " +
" select {[Measures].[Calls], [Measures].[ParallelPeriod]} on columns, " +
" NON EMPTY {Months} on rows " +
" from Calls " +
" Where(" + Parameters!px_workflows.value + ") "
I'm trying to reproduce this query in SSAS and RS 2005 and I can't seem to do it. My time dimension "[TimesDaily]" has one hierarchy, with the levels of [Yearname], [Monthname], and [Dayval]. I've tried variations of the following calculated member:
Sum(Descendants([TimesDaily].[Hierarchy].CurrentMember, [TimesDaily].[Hierarchy].[Monthname]), [Measures].[Calls])
This doesn't seem to be working, even without the filter for day. I need to be able to sum the values for a month, and be able to only take those days in the month that are prior to the current day. I.E., today's report would sum up the values for days 1-23 in each month listed in the report. Is there any way to do this using just CurrentMember? Any help would be greatly appreciated.
I actually figured out a way to do it. I first created a calculated member to get the current day:
[Measures].[CurrentDay] =
Tail({[TimesDaily].[Hierarchy].[Dayval].Members}, 1).item(0).MemberValue
Then I used topcount with the currentday member
[Measures].[Calls_MTD] =
Sum(TopCount(Descendants([TimesDaily].[Hierarchy].CurrentMember, 1), [Measures].[CurrentDay]), [Measures].[Calls])
I'm sure there's other ways to do this as well, like creating a Measure from the Time Dimension table and use the LastChild aggregation.
|||If I read your requirmenst right, it's actually much simpler than this:
First, I'm going to assume you have the TimeDaily set up correctly and the corretc meta data for it. If your not sure how this should be done, you can tie yourself up in knots trying to figure it out.
Second, your members could easily be:
With
Measures.myMTD as Sum( MTD( [TimesDaily].[Hierarchy].[Dayval].CurrentMember ), [Measures].[Calls] )
Measures.myMTDprev as Sum( MTD( ParrallelPeriod( [TimesDaily].[Hierarchy].[Monthval], 1, [TimesDaily].[Hierarchy].[Dayval].CurrentMember )), [Measures].[Calls] )
MDX MTD Calculation for Given Day In Month
I'm trying to get a MTD calculation up to a given day in a month for current and previous months. This is for a Reporting Services report. The columns will be Total Calls and Total Calls Through {X} Days in Month. The rows will just have the months listed. I was able to do this in RS 2000 using the following dynamic mdx statement:
= "WITH MEMBER [Measures].[ParallelPeriod] AS " +
" 'Sum({[TimesDaily.Calendar].CurrentMember.[1]:[TimesDaily.Calendar].CurrentMember.[" & Now.Day.ToString()& "]}, " + " [Measures].[Calls])' " +
" SET Months AS " +
" 'LastPeriods(" + CStr(Parameters!monthsback.value)+ " , Tail({[TimesDaily.Calendar].Monthname.Members}, 1).item(0))' " +
" select {[Measures].[Calls], [Measures].[ParallelPeriod]} on columns, " +
" NON EMPTY {Months} on rows " +
" from Calls " +
" Where(" + Parameters!px_workflows.value+ ") "
I'm trying to reproduce this query in SSAS and RS 2005 and I can't seem to do it. My time dimension "[TimesDaily]" has one hierarchy, with the levels of [Yearname], [Monthname], and [Dayval]. I've tried variations of the following calculated member:
Sum(Descendants([TimesDaily].[Hierarchy].CurrentMember, [TimesDaily].[Hierarchy].[Monthname]), [Measures].[Calls])
This doesn't seem to be working, even without the filter for day. I need to be able to sum the values for a month, and be able to only take those days in the month that are prior to the current day. I.E., today's report would sum up the values for days 1-23 in each month listed in the report. Is there any way to do this using just CurrentMember? Any help would be greatly appreciated.
I actually figured out a way to do it. I first created a calculated member to get the current day:
[Measures].[CurrentDay] =
Tail({[TimesDaily].[Hierarchy].[Dayval].Members}, 1).item(0).MemberValue
Then I used topcount with the currentday member
[Measures].[Calls_MTD] =
Sum(TopCount(Descendants([TimesDaily].[Hierarchy].CurrentMember, 1), [Measures].[CurrentDay]), [Measures].[Calls])
I'm sure there's other ways to do this as well, like creating a Measure from the Time Dimension table and use the LastChild aggregation.
|||If I read your requirmenst right, it's actually much simpler than this:
First, I'm going to assume you have the TimeDaily set up correctly and the corretc meta data for it. If your not sure how this should be done, you can tie yourself up in knots trying to figure it out.
Second, your members could easily be:
With
Measures.myMTD as Sum( MTD( [TimesDaily].[Hierarchy].[Dayval].CurrentMember ), [Measures].[Calls] )
Measures.myMTDprev as Sum( MTD( ParrallelPeriod( [TimesDaily].[Hierarchy].[Monthval], 1, [TimesDaily].[Hierarchy].[Dayval].CurrentMember )), [Measures].[Calls] )
MDX In Reporting Services Syntax help!
Have the following query in an RS report that tracks Projects and their
managers BY TIME from an Analysis services Cube. I want to be able to have a
query-based parameter on Geography.Division where by a user will be prompted
with a dropdown list and accordingly the query will be executed. The below
syntax is no working when i substituted .MEMBERS with .[" + Parameters!PDiv.
Value + "] for the {[Geography].[Div].[" + Parameters!PDiv.Value + "]} SET.
When I used the "*" instead of NONEMPTYCROSSJOIN, it worked. I would really
appreciate the help here.
='
WITH
MEMBER [measures].[Finish] AS 'iif(isempty([Measures].[Finished Count]),0,
[Measures].[Finished Count])'
MEMBER [measures].[Achieve] AS 'iif(isempty([Measures].[Passed Count]),0,
[Measures].[Achieved Count])'
MEMBER [measures].[Wait] AS 'iif(isempty([Measures].[Wait listed Count]),0,
[Measures].[Waiting Count])'
MEMBER [measures].[Hours] AS 'iif(isempty([Measures].[Time Consumed]),0,
[Measures].[Time Consumed])'
SELECT
{[Measures].[Finish],[Measures].[Achieve],[measures].[Wait],[Measures].[Hours]
} ON COLUMNS,
{NONEMPTYCROSSJOIN(NONEMPTYCROSSJOIN(NONEMPTYCROSSJOIN(NONEMPTYCROSSJOIN({
[Geography].[Div].[" + Parameters!PDiv.Value + "]} ,{[Project].[Project].
Members}),{[Manager].[Manager name].members}),{[Time].[Period Id].members}),{
[Person].[Person Job].members})}
ON ROWS
FROM [Project Evaluations]'
Thanks
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-reporting/200507/1first ensure that Parameters!PDiv.Value is actually the data you want, you
may find out that Parameters!PDiv.Label is actually what you want: I usually
have the ".Value" being the mdx unique member name, and the ".Label" being
the user friendly display name.
"James Woo via SQLMonster.com" wrote:
> Hi All,
> Have the following query in an RS report that tracks Projects and their
> managers BY TIME from an Analysis services Cube. I want to be able to have a
> query-based parameter on Geography.Division where by a user will be prompted
> with a dropdown list and accordingly the query will be executed. The below
> syntax is no working when i substituted .MEMBERS with .[" + Parameters!PDiv.
> Value + "] for the {[Geography].[Div].[" + Parameters!PDiv.Value + "]} SET.
> When I used the "*" instead of NONEMPTYCROSSJOIN, it worked. I would really
> appreciate the help here.
>
> ='
> WITH
> MEMBER [measures].[Finish] AS 'iif(isempty([Measures].[Finished Count]),0,
> [Measures].[Finished Count])'
> MEMBER [measures].[Achieve] AS 'iif(isempty([Measures].[Passed Count]),0,
> [Measures].[Achieved Count])'
> MEMBER [measures].[Wait] AS 'iif(isempty([Measures].[Wait listed Count]),0,
> [Measures].[Waiting Count])'
> MEMBER [measures].[Hours] AS 'iif(isempty([Measures].[Time Consumed]),0,
> [Measures].[Time Consumed])'
> SELECT
> {[Measures].[Finish],[Measures].[Achieve],[measures].[Wait],[Measures].[Hours]
> } ON COLUMNS,
> {NONEMPTYCROSSJOIN(NONEMPTYCROSSJOIN(NONEMPTYCROSSJOIN(NONEMPTYCROSSJOIN({
> [Geography].[Div].[" + Parameters!PDiv.Value + "]} ,{[Project].[Project].
> Members}),{[Manager].[Manager name].members}),{[Time].[Period Id].members}),{
> [Person].[Person Job].members})}
> ON ROWS
> FROM [Project Evaluations]'
> Thanks
>
> --
> Message posted via SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-reporting/200507/1
>|||I want the data in the pDiv since it will list all the Division from which i
can select one division to query on. I just have a problem with the syntax
and have tried different things to solve it wih no avail. Still need to get
the parameter passed to the .member in the MDX query. no solution here yet.
HELP :).
mike wrote:
>first ensure that Parameters!PDiv.Value is actually the data you want, you
>may find out that Parameters!PDiv.Label is actually what you want: I usually
>have the ".Value" being the mdx unique member name, and the ".Label" being
>the user friendly display name.
>> Hi All,
>> Have the following query in an RS report that tracks Projects and their
>[quoted text clipped - 28 lines]
>> Thanks
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-reporting/200507/1|||If the * syntax worked and Nonemptycrossjoin didn't, was there something
data-wise that was a problem with the * version? Why not just use what
works? NECJ has been deprecated in AS 2005, while it still functions, its
use is discouraged.
Also, there is no need to nest four NonEmptyCrossJoins - unlike the
CrossJoin which only takes two arguments, you can combine several dimensions
in a single function call: nonemptycrossjoin(A, B, C, D, E). This will
return a result with dimensionality A*B*C*D*E. If you want to ensure
non-emptyness across these five dimensions but have a result with A*B*C
dimensionality, use nonemptycrossjoin(A,B,C,D,E,3)
If that doesn't work, I can only fall back on the RS 2000 Samples. The
parameterized Foodmart sample report actually brings back all of the Product
data, and then uses a filter on the BrandSales matrix object to restrict
data to the product family selected from the families listed in the
parameter query. In your case, you would have a second MDX query that pulls
back a list of Divisions, and the main query would pull back all project
data, but you could filter it to only the desired Division. Because the
parameter is evaluated in the RS context (as opposed to MDX) it works. But
this is not a true parameterized query, it is a clever hack.
In RS 2005, MDX parameters are more like the @.syntax of SQL parameters, and
can be evaluated on the query side. The parameter is usually selected
through the FROM clause. I doubt if this will work for you in RS 2000, but
here is a sample RS 2005 dataset with two parameters:
SELECT NON EMPTY { [Measures].[Total Amount] } ON COLUMNS, NON EMPTY {
([Time].[MONTH LDESC].[MONTH LDESC].ALLMEMBERS *
[Providers].[Category].[Provider].ALLMEMBERS ) } DIMENSION PROPERTIES
MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( [Buyers] ) ON
COLUMNS FROM ( SELECT ( STRTOSET(@.ProvidersCategory, CONSTRAINED) ) ON
COLUMNS FROM ( SELECT ( STRTOMEMBER(@.TimeMONTHLDESC,
CONSTRAINED):STRTOMEMBER(@.TimeMONTHLDESC, CONSTRAINED).Lead(11) ) ON COLUMNS
FROM [Core Knowledge]))) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR,
FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
Note the * syntyax within NON EMPTY( ... ) instead of NonEmptyCrossJoin.
Cheers, Mark
"James Woo via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:5150E35762913@.SQLMonster.com...
>I want the data in the pDiv since it will list all the Division from which
>i
> can select one division to query on. I just have a problem with the syntax
> and have tried different things to solve it wih no avail. Still need to
> get
> the parameter passed to the .member in the MDX query. no solution here
> yet.
> HELP :).
> mike wrote:
>>first ensure that Parameters!PDiv.Value is actually the data you want, you
>>may find out that Parameters!PDiv.Label is actually what you want: I
>>usually
>>have the ".Value" being the mdx unique member name, and the ".Label" being
>>the user friendly display name.
>> Hi All,
>> Have the following query in an RS report that tracks Projects and their
>>[quoted text clipped - 28 lines]
>> Thanks
>
> --
> Message posted via SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-reporting/200507/1|||don't use single quote: use double quote see below;
="WITH
MEMBER [measures].[Finish] AS 'iif(isempty([Measures].[Finished Count]),0,
[Measures].[Finished Count])'
MEMBER [measures].[Achieve] AS 'iif(isempty([Measures].[Passed Count]),0,
[Measures].[Achieved Count])'
MEMBER [measures].[Wait] AS 'iif(isempty([Measures].[Wait listed Count]),0,
[Measures].[Waiting Count])'
MEMBER [measures].[Hours] AS 'iif(isempty([Measures].[Time Consumed]),0,
[Measures].[Time Consumed])'
SELECT
{[Measures].[Finish],[Measures].[Achieve],[measures].[Wait],[Measures].[Hours]
} ON COLUMNS,
{NONEMPTYCROSSJOIN(NONEMPTYCROSSJOIN(NONEMPTYCROSSJOIN(NONEMPTYCROSSJOIN({
[Geography].[Div].[" + Parameters!PDiv.Value + "]} ,{[Project].[Project].
Members}),{[Manager].[Manager name].members}),{[Time].[Period Id].members}),{
[Person].[Person Job].members})}
ON ROWS
FROM [Project Evaluations]"
"James Woo via SQLMonster.com" wrote:
> I want the data in the pDiv since it will list all the Division from which i
> can select one division to query on. I just have a problem with the syntax
> and have tried different things to solve it wih no avail. Still need to get
> the parameter passed to the .member in the MDX query. no solution here yet.
> HELP :).
> mike wrote:
> >first ensure that Parameters!PDiv.Value is actually the data you want, you
> >may find out that Parameters!PDiv.Label is actually what you want: I usually
> >have the ".Value" being the mdx unique member name, and the ".Label" being
> >the user friendly display name.
> >
> >> Hi All,
> >> Have the following query in an RS report that tracks Projects and their
> >[quoted text clipped - 28 lines]
> >>
> >> Thanks
>
> --
> Message posted via SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-reporting/200507/1
>|||1- thanks for all the Advice.
2- the Query in the report worked after changing to Non Empty(SET1*SET2*SET3,
etc).
3- AS 2000: Should I use NON EMPTY (SET1*SET2*SET3,etc). instead of NECJ
(SET1,SET2,SET3,etc) ? What is the difference?
4- Switching to SQLServer/AS2005 in three weeks. New set of books, new ulcer
precription, and lots of questions.:). Do you recommend for sql 2000 to sql
2005 Analysis services migration, books, articles, site. etc.?
Thank you,
James
Mark Job wrote:
>If the * syntax worked and Nonemptycrossjoin didn't, was there something
>data-wise that was a problem with the * version? Why not just use what
>works? NECJ has been deprecated in AS 2005, while it still functions, its
>use is discouraged.
>Also, there is no need to nest four NonEmptyCrossJoins - unlike the
>CrossJoin which only takes two arguments, you can combine several dimensions
>in a single function call: nonemptycrossjoin(A, B, C, D, E). This will
>return a result with dimensionality A*B*C*D*E. If you want to ensure
>non-emptyness across these five dimensions but have a result with A*B*C
>dimensionality, use nonemptycrossjoin(A,B,C,D,E,3)
>If that doesn't work, I can only fall back on the RS 2000 Samples. The
>parameterized Foodmart sample report actually brings back all of the Product
>data, and then uses a filter on the BrandSales matrix object to restrict
>data to the product family selected from the families listed in the
>parameter query. In your case, you would have a second MDX query that pulls
>back a list of Divisions, and the main query would pull back all project
>data, but you could filter it to only the desired Division. Because the
>parameter is evaluated in the RS context (as opposed to MDX) it works. But
>this is not a true parameterized query, it is a clever hack.
>In RS 2005, MDX parameters are more like the @.syntax of SQL parameters, and
>can be evaluated on the query side. The parameter is usually selected
>through the FROM clause. I doubt if this will work for you in RS 2000, but
>here is a sample RS 2005 dataset with two parameters:
>SELECT NON EMPTY { [Measures].[Total Amount] } ON COLUMNS, NON EMPTY {
>([Time].[MONTH LDESC].[MONTH LDESC].ALLMEMBERS *
>[Providers].[Category].[Provider].ALLMEMBERS ) } DIMENSION PROPERTIES
>MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( [Buyers] ) ON
>COLUMNS FROM ( SELECT ( STRTOSET(@.ProvidersCategory, CONSTRAINED) ) ON
>COLUMNS FROM ( SELECT ( STRTOMEMBER(@.TimeMONTHLDESC,
>CONSTRAINED):STRTOMEMBER(@.TimeMONTHLDESC, CONSTRAINED).Lead(11) ) ON COLUMNS
>FROM [Core Knowledge]))) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR,
>FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
>Note the * syntyax within NON EMPTY( ... ) instead of NonEmptyCrossJoin.
>Cheers, Mark
>>I want the data in the pDiv since it will list all the Division from which
>>i
>[quoted text clipped - 16 lines]
>> Thanks
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-reporting/200507/1|||Before I answer you questions, a quick one for you. I assumed that your MDX
was in a dataset, but then I saw the expression (=' <MDX query> ') syntax.
Did you have that embedded in some other RS object?
Now for your questions. I apologize in advance if I run on...
3) well, one difference is that NON EMPTY (S1 * S2 * S3) works ;-)
the other difference is in the dimensionality of the returned data. It is
harder to see this in RS, you might want to try the MDX Sample application
which helps you to visualize the returned data better. RS distorts the true
query results into a flattened rowset, whereas true MDX can return a
multi-dimensional result set, or combinations of dimensions on rows and
columns (and up to 63 total dimensions).
What I mean by "dimensionality" is that a S1 * S2 * S3 will be a result set
with all three of those dimensions - a set of three element tuples. With
NECJ you can test for non-null combinations across more attributes, but then
return a result set with fewer dimensions than what you tested, which is
sometimes useful. So if you use Nonemptycrossjoin(Set1, Set2, Set3, Set4,
Set5, 3), that last numeric argument says "I want to check all five of these
dimensions to make sure the intersection yields a non-null result, but when
you've done that, return a set of tuples on only the first three dimensions
Set1, Set2 and Set3."
I read that NECJ has been deprecated because it has problems. If you read
some of the textbooks and whitepapers out there, there are times when you
may want to use one or the other for efficiency - there is a good recorded
TechNet webcast on Common Mistakes in MDX that you can Google for that
constrasts NECJ and Nonempty. I can dig it up if you hace trouble finding
it.
4) Not sure I am parsing your question correctly. If you are looking for an
endorsement of SS / AS 2005, then yes, emphatically. Lots of cool new
stuff. If you are looking for texts, that is a broad question - SS, RS, AS,
MDX, etc. As for books, things are still pretty sparse.
I've heard that both Spofford et al (MDX Solutions) and Pasumansky et al
(Fast Track to MDX) are writing new versions. The former is a great
reference source and has pretty much everything you'd ever want to know
about MDX, but can be a difficult slog some times and a great sleeping pill
at others. But I couldn't do MDX without it. Mosha's Fast Tracks book is
more accessible, but not as complete as Spofford's. But then Mosha is right
there on the development team, and is a great authority.
For RS, I am sure that Stacia Misner, Teo Lachev, Peter Blackburn and
everyone else will update their existing texts sooner or later. IMO RS in
some ways has fewer changes than most of SS2005, but in others (especially
the ad hoc Report Builder) there is a lot of new material to write about.
The appetite for RS books is also greater than all the rest due to the end
user impact.
As for AS 2005, the changes there are huge. There weren't many good texts
on AS 2000, but Reed Jacobsen's Analysis Services Step by Step was all you
really needed. I sincerely hope that he will be updating his book for
Yukon.
Amd if you're looking for consultants, well, I know a few ;-)
"James Woo via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:5152FC4E590A3@.SQLMonster.com...
> 1- thanks for all the Advice.
> 2- the Query in the report worked after changing to Non
> Empty(SET1*SET2*SET3,
> etc).
> 3- AS 2000: Should I use NON EMPTY (SET1*SET2*SET3,etc). instead of NECJ
> (SET1,SET2,SET3,etc) ? What is the difference?
> 4- Switching to SQLServer/AS2005 in three weeks. New set of books, new
> ulcer
> precription, and lots of questions.:). Do you recommend for sql 2000 to
> sql
> 2005 Analysis services migration, books, articles, site. etc.?
> Thank you,
> James
> Mark Job wrote:
>>If the * syntax worked and Nonemptycrossjoin didn't, was there something
>>data-wise that was a problem with the * version? Why not just use what
>>works? NECJ has been deprecated in AS 2005, while it still functions, its
>>use is discouraged.
>>Also, there is no need to nest four NonEmptyCrossJoins - unlike the
>>CrossJoin which only takes two arguments, you can combine several
>>dimensions
>>in a single function call: nonemptycrossjoin(A, B, C, D, E). This will
>>return a result with dimensionality A*B*C*D*E. If you want to ensure
>>non-emptyness across these five dimensions but have a result with A*B*C
>>dimensionality, use nonemptycrossjoin(A,B,C,D,E,3)
>>If that doesn't work, I can only fall back on the RS 2000 Samples. The
>>parameterized Foodmart sample report actually brings back all of the
>>Product
>>data, and then uses a filter on the BrandSales matrix object to restrict
>>data to the product family selected from the families listed in the
>>parameter query. In your case, you would have a second MDX query that
>>pulls
>>back a list of Divisions, and the main query would pull back all project
>>data, but you could filter it to only the desired Division. Because the
>>parameter is evaluated in the RS context (as opposed to MDX) it works.
>>But
>>this is not a true parameterized query, it is a clever hack.
>>In RS 2005, MDX parameters are more like the @.syntax of SQL parameters,
>>and
>>can be evaluated on the query side. The parameter is usually selected
>>through the FROM clause. I doubt if this will work for you in RS 2000,
>>but
>>here is a sample RS 2005 dataset with two parameters:
>>SELECT NON EMPTY { [Measures].[Total Amount] } ON COLUMNS, NON EMPTY {
>>([Time].[MONTH LDESC].[MONTH LDESC].ALLMEMBERS *
>>[Providers].[Category].[Provider].ALLMEMBERS ) } DIMENSION PROPERTIES
>>MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( [Buyers] ) ON
>>COLUMNS FROM ( SELECT ( STRTOSET(@.ProvidersCategory, CONSTRAINED) ) ON
>>COLUMNS FROM ( SELECT ( STRTOMEMBER(@.TimeMONTHLDESC,
>>CONSTRAINED):STRTOMEMBER(@.TimeMONTHLDESC, CONSTRAINED).Lead(11) ) ON
>>COLUMNS
>>FROM [Core Knowledge]))) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR,
>>FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
>>Note the * syntyax within NON EMPTY( ... ) instead of NonEmptyCrossJoin.
>>Cheers, Mark
>>I want the data in the pDiv since it will list all the Division from
>>which
>>i
>>[quoted text clipped - 16 lines]
>> Thanks
>
> --
> Message posted via SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-reporting/200507/1|||Mark Dude;
1- Thanks a bunch for you detailed answers. Sometimes, I wish that all
answers given in this forum are as thorough as yours, but then, no complaints
here. Great advice and clarity.
Thanks again, and have a great weekend.
Go Yankees. Go Buckeyes. :).
Mark Job wrote:
>Before I answer you questions, a quick one for you. I assumed that your MDX
>was in a dataset, but then I saw the expression (=' <MDX query> ') syntax.
>Did you have that embedded in some other RS object?
>Now for your questions. I apologize in advance if I run on...
>3) well, one difference is that NON EMPTY (S1 * S2 * S3) works ;-)
>the other difference is in the dimensionality of the returned data. It is
>harder to see this in RS, you might want to try the MDX Sample application
>which helps you to visualize the returned data better. RS distorts the true
>query results into a flattened rowset, whereas true MDX can return a
>multi-dimensional result set, or combinations of dimensions on rows and
>columns (and up to 63 total dimensions).
> What I mean by "dimensionality" is that a S1 * S2 * S3 will be a result set
>with all three of those dimensions - a set of three element tuples. With
>NECJ you can test for non-null combinations across more attributes, but then
>return a result set with fewer dimensions than what you tested, which is
>sometimes useful. So if you use Nonemptycrossjoin(Set1, Set2, Set3, Set4,
>Set5, 3), that last numeric argument says "I want to check all five of these
>dimensions to make sure the intersection yields a non-null result, but when
>you've done that, return a set of tuples on only the first three dimensions
>Set1, Set2 and Set3."
>I read that NECJ has been deprecated because it has problems. If you read
>some of the textbooks and whitepapers out there, there are times when you
>may want to use one or the other for efficiency - there is a good recorded
>TechNet webcast on Common Mistakes in MDX that you can Google for that
>constrasts NECJ and Nonempty. I can dig it up if you hace trouble finding
>it.
>4) Not sure I am parsing your question correctly. If you are looking for an
>endorsement of SS / AS 2005, then yes, emphatically. Lots of cool new
>stuff. If you are looking for texts, that is a broad question - SS, RS, AS,
>MDX, etc. As for books, things are still pretty sparse.
>I've heard that both Spofford et al (MDX Solutions) and Pasumansky et al
>(Fast Track to MDX) are writing new versions. The former is a great
>reference source and has pretty much everything you'd ever want to know
>about MDX, but can be a difficult slog some times and a great sleeping pill
>at others. But I couldn't do MDX without it. Mosha's Fast Tracks book is
>more accessible, but not as complete as Spofford's. But then Mosha is right
>there on the development team, and is a great authority.
>For RS, I am sure that Stacia Misner, Teo Lachev, Peter Blackburn and
>everyone else will update their existing texts sooner or later. IMO RS in
>some ways has fewer changes than most of SS2005, but in others (especially
>the ad hoc Report Builder) there is a lot of new material to write about.
>The appetite for RS books is also greater than all the rest due to the end
>user impact.
>As for AS 2005, the changes there are huge. There weren't many good texts
>on AS 2000, but Reed Jacobsen's Analysis Services Step by Step was all you
>really needed. I sincerely hope that he will be updating his book for
>Yukon.
>Amd if you're looking for consultants, well, I know a few ;-)
>> 1- thanks for all the Advice.
>> 2- the Query in the report worked after changing to Non
>[quoted text clipped - 63 lines]
>> Thanks
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-reporting/200507/1|||Here is the URL thast Mark has refered to regarding the TechNet Support
WebCast: Common MDX mistakes and solutions in Microsoft SQL Server 2000
Analysis Services
http://support.microsoft.com/default.aspx?kbid=886991
Thanks
James
Mark Job wrote:
>Before I answer you questions, a quick one for you. I assumed that your MDX
>was in a dataset, but then I saw the expression (=' <MDX query> ') syntax.
>Did you have that embedded in some other RS object?
>Now for your questions. I apologize in advance if I run on...
>3) well, one difference is that NON EMPTY (S1 * S2 * S3) works ;-)
>the other difference is in the dimensionality of the returned data. It is
>harder to see this in RS, you might want to try the MDX Sample application
>which helps you to visualize the returned data better. RS distorts the true
>query results into a flattened rowset, whereas true MDX can return a
>multi-dimensional result set, or combinations of dimensions on rows and
>columns (and up to 63 total dimensions).
> What I mean by "dimensionality" is that a S1 * S2 * S3 will be a result set
>with all three of those dimensions - a set of three element tuples. With
>NECJ you can test for non-null combinations across more attributes, but then
>return a result set with fewer dimensions than what you tested, which is
>sometimes useful. So if you use Nonemptycrossjoin(Set1, Set2, Set3, Set4,
>Set5, 3), that last numeric argument says "I want to check all five of these
>dimensions to make sure the intersection yields a non-null result, but when
>you've done that, return a set of tuples on only the first three dimensions
>Set1, Set2 and Set3."
>I read that NECJ has been deprecated because it has problems. If you read
>some of the textbooks and whitepapers out there, there are times when you
>may want to use one or the other for efficiency - there is a good recorded
>TechNet webcast on Common Mistakes in MDX that you can Google for that
>constrasts NECJ and Nonempty. I can dig it up if you hace trouble finding
>it.
>4) Not sure I am parsing your question correctly. If you are looking for an
>endorsement of SS / AS 2005, then yes, emphatically. Lots of cool new
>stuff. If you are looking for texts, that is a broad question - SS, RS, AS,
>MDX, etc. As for books, things are still pretty sparse.
>I've heard that both Spofford et al (MDX Solutions) and Pasumansky et al
>(Fast Track to MDX) are writing new versions. The former is a great
>reference source and has pretty much everything you'd ever want to know
>about MDX, but can be a difficult slog some times and a great sleeping pill
>at others. But I couldn't do MDX without it. Mosha's Fast Tracks book is
>more accessible, but not as complete as Spofford's. But then Mosha is right
>there on the development team, and is a great authority.
>For RS, I am sure that Stacia Misner, Teo Lachev, Peter Blackburn and
>everyone else will update their existing texts sooner or later. IMO RS in
>some ways has fewer changes than most of SS2005, but in others (especially
>the ad hoc Report Builder) there is a lot of new material to write about.
>The appetite for RS books is also greater than all the rest due to the end
>user impact.
>As for AS 2005, the changes there are huge. There weren't many good texts
>on AS 2000, but Reed Jacobsen's Analysis Services Step by Step was all you
>really needed. I sincerely hope that he will be updating his book for
>Yukon.
>Amd if you're looking for consultants, well, I know a few ;-)
>> 1- thanks for all the Advice.
>> 2- the Query in the report worked after changing to Non
>[quoted text clipped - 63 lines]
>> Thanks
Message posted via http://www.sqlmonster.com