Showing posts with label include. Show all posts
Showing posts with label include. Show all posts

Wednesday, March 28, 2012

Parameter list with root 'All ...' member

Hi,
I am trying to create simple parameter list that include members of some
dimension with their root 'All ...' member.
I want to accomplish list like this
All Countries
France
Germany
USA
...
Simple MDX, but in Reporting services dataset I get
<null> 1000
France 100
Germany 100
USA 100
... ...
Both 'All Countries' and Country members are present but with <null> for
'All Countries'.
I try different MDX-es with same result.
How can I get such results?
Thanks.Hi,
I too have the same problem..I am using Analysis services dataset. I am
seeing the "ALL" parameter in the drop-down list, for countries..But,when I
click on "all" I don't see any result..the rest works fine..why would this
happen?..
Please help us.
Thanks,
Sankar
"Don" <Don@.discussions.microsoft.com> wrote in message
news:7AD87583-D1A6-4453-86E1-70D39F99BB45@.microsoft.com...
> Hi,
> I am trying to create simple parameter list that include members of some
> dimension with their root 'All ...' member.
> I want to accomplish list like this
> All Countries
> France
> Germany
> USA
> ...
> Simple MDX, but in Reporting services dataset I get
> <null> 1000
> France 100
> Germany 100
> USA 100
> ... ...
> Both 'All Countries' and Country members are present but with <null> for
> 'All Countries'.
> I try different MDX-es with same result.
> How can I get such results?
> Thanks.
>

Monday, March 26, 2012

Parameter calendar control : week start date

With Reporting Services (SQL Server 2005), if you include a parameter with a
data type of DateTime, you get a calendar control for the parameter on your
report.
How do you change the first day of the week from Sunday to Monday?
Thanks,
CraigIs your question related to calender control, because you have asked
seperately,
in fact you cant change the calender control. Ofcourse in sql server yes you
can by giving
SET DATEFIRST 1 (Monday)
SET DATEFIRST 7 (Sunday - Default)
Amarnath
"CraigHB" wrote:
> With Reporting Services (SQL Server 2005), if you include a parameter with a
> data type of DateTime, you get a calendar control for the parameter on your
> report.
> How do you change the first day of the week from Sunday to Monday?
> Thanks,
> Craig

Friday, March 23, 2012

parameter area extension

How can I extend Reporting services UI to include into input
parameter's area TreeView control like to calendar picker ?
Thank you in advance,
L.Lubich,
MCSD, Web programmerneed to write your own UI, since SSRS doesn't provide facitilites for
changing the UI of the report.
Amarnath
"Lubich" wrote:
> How can I extend Reporting services UI to include into input
> parameter's area TreeView control like to calendar picker ?
> Thank you in advance,
> L.Lubich,
> MCSD, Web programmer
>

ParallelPeriod, Subcubes, and SP2

We're defining some KPIs that include trend expressions which use the ParallelPeriod function to calculate the change in a KPI value since a past time period. For example, we calculate the change in the KPI value

When we use an MDX SELECT with a WHERE clause that specifies a time slice, the expression evaluates correctly.

However, when we use CREATE SUBCUBE to do the filter, or use BI Studio (which creates a subcube), the result is incorrect. In particular, the there's an IsEmpty check for the parallel period of the KPI value, so we're not doing bogus math when there's no data for the previous period. With the WHERE clause, that works fine, but with the subcube, the ParallelPeriod always evaluates to empty.

As a point of comparison, I tested with the Adventure Works cube, usign the "Internet Revenue" KPI, which includes a similar type of KPI trend (revenue for Current Time Member - Revenue for previous Fiscal Year). I see the same behavior there. This:
select
{KPIValue("Internet Revenue"), KPIGoal("Internet Revenue"), KPIStatus("Internet Revenue"), KPITrend("Internet Revenue")}
on columns
from
[Adventure Works]
where {[Date].[Fiscal Year].&[2004]}

returns 1 for the trend, but this:

CREATE SUBCUBE [Adventure Works] AS ( SELECT ( { [Date].[Fiscal Year].&[2004] } ) ON COLUMNS FROM [Adventure Works])

select
{KPIValue("Internet Revenue"), KPIGoal("Internet Revenue"), KPIStatus("Internet Revenue"), KPITrend("Internet Revenue")}
on columns
from
[Adventure Works]

returns 0.

So after lots of reading, I THOUGHT that SP2 fixed this problem. However, we installed the December CTP of SP2, and it doesn't seem to.Since subselects and CREATE SUBCUBE do not set current coordinate on non-aggregatable attributes, functions which look at them (such as ParallelPeriod, PrevMember, Lag, Parent, LastChild etc) won't apply. There were no change in SP2 in this respect. You can still use WHERE clause to set the current coordinate though.|||Ouch. I'm not sure how I came to believe this was being fixed in SP2.

Does Microsoft consider this a bug? Design limitation? Any plans to address it at some point?

Since we have no control over how query tools generate their MDX, it seems difficult to design a cube that uses these functions and have confidence that it will work correctly for our customers.|||

This is not a bug, but rather a design decision. Perhaps it can be reconsidered in the future versions. I don't know which tool you use, but at least Excel 2007 wihch makes extensive use of subselects, does use WHERE clause when the slice is a single member (and ParallelPeriod won't work on multi-select anyways).

HTH,

Mosha.

|||I was quite concerned about Excel 2007, as I saw lots of mentions that Excel uses subselects and subcubes out on the web. However, I did some quick testing, and as you say, it does seem to use the where clause in this case. That makes me feel a little better. Our QA people have mostly been testing with the BI Studio KPI browser so far, which exhibits the problem. The other client we need to test is Sharepoint 2007.

Can you share any insight about the rationale for SSAS work this way? In my Google I've seen numerous other people discussing this as a problem, so I hope MS seriously considers addressing it in a future release. We're trying very hard to stay query-tool agnostic in our designs - this definitely makes that more difficult.

Thanks,
Kevin|||

> In my Google I've seen numerous other people discussing this as a problem, so I hope MS seriously considers addressing it in a future release.

First, I do not use Google, I use Microsoft Live Search (www.live.com) instead. Subselects were originally designed to solve different class of problems, but the actual usage proved that people wanted to use them as more functionality rich WHERE clause, although we have tried to separate the functionalities of subselects and WHERE. This obviously didn't work out well, therefore SP2 brought many changes that made subselects and WHERE to be closer. It is correct to assume, that Microsoft seriously considers addressing this issue in the future release.

|||>First, I do not use Google, I use Microsoft Live Search
Naturally. But MS Live Search is so much harder to turn into a verb. ;)

>Microsoft seriously considers addressing this issue in the future release.

When you say "future release" - is this something that could theoretically be addressed in a service pack, were there sufficient demand? Or is it too significant a change for that, and we should expect to have to wait for the next full version of SSAS for a fix?

|||We never discuss the future plans or features that may be added in the future. All I said was that Microsoft is aware of the issue and seriously considers it. When and whether something will be done about it - is up to the product team, and will be disclosed through appropriate channels.|||

Thanks for the posting. I have been testing using both BIDS and the MOSS KPI webpart. For KPI's, BIDS implements an explicit CREATE SUBCUBE for slicing while Sharepoint 2007 seems to use an in-line subselect in the FROM clause to apply the selection from the filter webpart. In both cases a KPI based on a non-calculated measure works fine while any calculated measure based on a ParallelPeriod returns a null. Given the behavior in SP2 is there any available method for defining trend-type KPI's that depend on ParallelPeriod (or similar) functionality? Many of our KPI's depend on calculating the % change from the prior period.

Thanks

John

|||BIDS KPI browser is not end-user client tool, and therefore can be safely ignored here. As far MOSS KPI webpart, I suggest you report this issue to Sharepoint team, and ask them to use WHERE clause instead of subselect (or in addition to subselect if they choose so).|||

I have posted a question on the Sharepoint forum to ask about the KPI webpart.

As for BIDS, there's a point I don't understand. The profiler shows BIDS issuing a CREATE SUBCUBE statement as the slicer before the KPI query is excuted. We're using SQL Server 2005 SP2 and the updated BOL from December contains the following text in the description of the CREATE SUBCUBE statement:

"Also, explicit references to cells outside the subcube return cell values that are evaluated in the context of the whole cube. For example, you create a subcube that is limited to the current year. You then use the ParallelPeriod function to compare the current year to the previous year. The difference in values will be returned even though the previous year’s value lies outside the subcube."

Is this statement correct? Should a ParallelPeriod that defines a member outside the current context as specified by a CREATE SUBCUBE still return a value?

Thanks

|||Yes the statement in BOL is correct. The issue here is that subselect doesn't change current coordinate, so you are looking at ParallelPeriod of All member, which is NULL.

Monday, March 12, 2012

Paging records on SQL 2000 : Followup question

You are right, I did not include the exact query since it has a whole
of joins and many where clauses in it.
I did not want to make the post very hard to read, hence I simplified
it.
In the Stored proc I am using a String variable @.SQLString
varchar(2000) to hold the entire select statement, and then executing
that SQL using EXEC (@.SQLString).
Thus for debugging, I used Query Analyzer, and within the Analyzer I am
using the Select statement.
So in my test I do not use any stored proc.
so one select statement says:
Select * from ( Select Top 600 * from
( Select Top 2000 * from
( Select Top 2000 PermitNumber, HouseNumber, OnStreetName,
FromStreetName, ToStreetName, WorkStartDate as "WorkStart",
tbl_Permittee.Permittee_name as PermitteeName, PermitteeNumber,
PermitType_ID as "Type",
InspectionDistrict,
PermitStatus,
IssueDate
>From PermitMain inner join tbl_Permittee
on PermitMain.PermitteeNumber = tbl_Permittee.Permittee_Number
and (tbl_Permittee.Permittee_name_flag = 'd' or
tbl_Permittee.Permittee_name_flag = 'p')
where
(PermitType_ID like '01%' ) and worktypeid is null
and ((IssueDate between @.IssueDateFrom and @.IssueDateTo) or
(EmergIssueDate between @.IssueDateFrom and @.IssueDateTo))
and PermitteeNumber = @.PermitteeNumber
and PermitMain.Boroughcode = @.Boro
order by WorkStart DESC
) as T2 order by WorkStart ASC
) as T3
) as T4 order by WorkStart DESC
THIS ONE RUNS FAST and RETURNS RESULTS.
The Other Select statement:
Select * from ( Select Top 600 * from
( Select Top 2000 * from
( Select Top 2000 PermitNumber, HouseNumber, OnStreetName,
FromStreetName, ToStreetName, WorkStartDate as "WorkStart",
tbl_Permittee.Permittee_name as PermitteeName, PermitteeNumber,
PermitType_ID as "Type",
InspectionDistrict,
PermitStatus,
IssueDate
>From PermitMain inner join tbl_Permittee
on PermitMain.PermitteeNumber = tbl_Permittee.Permittee_Number
and (tbl_Permittee.Permittee_name_flag = 'd' or
tbl_Permittee.Permittee_name_flag = 'p')
where
(PermitType_ID like @.WorkTYPE ) and worktypeid is null
and ((IssueDate between @.IssueDateFrom and @.IssueDateTo) or
(EmergIssueDate between @.IssueDateFrom and @.IssueDateTo))
and PermitteeNumber = @.PermitteeNumber
and PermitMain.Boroughcode = @.Boro
order by WorkStart DESC
) as T2 order by WorkStart ASC
) as T3
) as T4 order by WorkStart DESC
TAKES FOREVER to COMPLETE.
However IF I INCREASE the PAGESIZE from 600 to 800, BOTH QUERIES RETURN
RESULTS EQUALLY FAST.
Thanks for your help> You are right, I did not include the exact query since it has a whole
> of joins and many where clauses in it.
Can you *PLEASE* not start a new thread for every reply?
A|||On 26 Jan 2007 05:56:21 -0800, "rbg" <rbg.net@.gmail.com> wrote:
>Select * from ( Select Top 600 * from
...
>(PermitType_ID like '01%' ) and worktypeid is null
...
>THIS ONE RUNS FAST and RETURNS RESULTS.
>The Other Select statement:
>Select * from ( Select Top 600 * from
...
>(PermitType_ID like @.WorkTYPE ) and worktypeid is null
...
>TAKES FOREVER to COMPLETE.
>However IF I INCREASE the PAGESIZE from 600 to 800, BOTH QUERIES RETURN
>RESULTS EQUALLY FAST.
Seems incredibly unlikely that the 600/800 would make a difference.
My guess would be that the "like @.variable" can't know in advance that
the value will be single and have only a trialing wildcard, so it does
a scan instead of using the index. This uses a lot more of both CPU
and diskio. This would make it more sensitive to contention from
other system activities. Are you sure there was nothing else running
on the system when you were doing the comparisons?
J.

Paging records on SQL 2000 : Followup question

You are right, I did not include the exact query since it has a whole
of joins and many where clauses in it.
I did not want to make the post very hard to read, hence I simplified
it.
In the Stored proc I am using a String variable @.SQLString
varchar(2000) to hold the entire select statement, and then executing
that SQL using EXEC (@.SQLString).
Thus for debugging, I used Query Analyzer, and within the Analyzer I am
using the Select statement.
So in my test I do not use any stored proc.
so one select statement says:
Select * from ( Select Top 600 * from
( Select Top 2000 * from
( Select Top 2000 PermitNumber, HouseNumber, OnStreetName,
FromStreetName, ToStreetName, WorkStartDate as "WorkStart",
tbl_Permittee.Permittee_name as PermitteeName, PermitteeNumber,
PermitType_ID as "Type",
InspectionDistrict,
PermitStatus,
IssueDate
>From PermitMain inner join tbl_Permittee
on PermitMain.PermitteeNumber = tbl_Permittee.Permittee_Number
and (tbl_Permittee.Permittee_name_flag = 'd' or
tbl_Permittee.Permittee_name_flag = 'p')
where
(PermitType_ID like '01%' ) and worktypeid is null
and ((IssueDate between @.IssueDateFrom and @.IssueDateTo) or
(EmergIssueDate between @.IssueDateFrom and @.IssueDateTo))
and PermitteeNumber = @.PermitteeNumber
and PermitMain.Boroughcode = @.Boro
order by WorkStart DESC
) as T2 order by WorkStart ASC
) as T3
) as T4 order by WorkStart DESC
THIS ONE RUNS FAST and RETURNS RESULTS.
The Other Select statement:
Select * from ( Select Top 600 * from
( Select Top 2000 * from
( Select Top 2000 PermitNumber, HouseNumber, OnStreetName,
FromStreetName, ToStreetName, WorkStartDate as "WorkStart",
tbl_Permittee.Permittee_name as PermitteeName, PermitteeNumber,
PermitType_ID as "Type",
InspectionDistrict,
PermitStatus,
IssueDate
>From PermitMain inner join tbl_Permittee
on PermitMain.PermitteeNumber = tbl_Permittee.Permittee_Number
and (tbl_Permittee.Permittee_name_flag = 'd' or
tbl_Permittee.Permittee_name_flag = 'p')
where
(PermitType_ID like @.WorkTYPE ) and worktypeid is null
and ((IssueDate between @.IssueDateFrom and @.IssueDateTo) or
(EmergIssueDate between @.IssueDateFrom and @.IssueDateTo))
and PermitteeNumber = @.PermitteeNumber
and PermitMain.Boroughcode = @.Boro
order by WorkStart DESC
) as T2 order by WorkStart ASC
) as T3
) as T4 order by WorkStart DESC
TAKES FOREVER to COMPLETE.
However IF I INCREASE the PAGESIZE from 600 to 800, BOTH QUERIES RETURN
RESULTS EQUALLY FAST.
Thanks for your help> You are right, I did not include the exact query since it has a whole
> of joins and many where clauses in it.
Can you *PLEASE* not start a new thread for every reply?
A|||On 26 Jan 2007 05:56:21 -0800, "rbg" <rbg.net@.gmail.com> wrote:

>Select * from ( Select Top 600 * from
...
>(PermitType_ID like '01%' ) and worktypeid is null
...
>THIS ONE RUNS FAST and RETURNS RESULTS.

>The Other Select statement:
>Select * from ( Select Top 600 * from
...
>(PermitType_ID like @.WorkTYPE ) and worktypeid is null
...
>TAKES FOREVER to COMPLETE.

>However IF I INCREASE the PAGESIZE from 600 to 800, BOTH QUERIES RETURN
>RESULTS EQUALLY FAST.
Seems incredibly unlikely that the 600/800 would make a difference.
My guess would be that the "like @.variable" can't know in advance that
the value will be single and have only a trialing wildcard, so it does
a scan instead of using the index. This uses a lot more of both CPU
and diskio. This would make it more sensitive to contention from
other system activities. Are you sure there was nothing else running
on the system when you were doing the comparisons?
J.

Paging records on SQL 2000 : Followup question

You are right, I did not include the exact query since it has a whole
of joins and many where clauses in it.
I did not want to make the post very hard to read, hence I simplified
it.

In the Stored proc I am using a String variable @.SQLString
varchar(2000) to hold the entire select statement, and then executing
that SQL using EXEC (@.SQLString).

Thus for debugging, I used Query Analyzer, and within the Analyzer I am
using the Select statement.
So in my test I do not use any stored proc.

so one select statement says:

Select * from ( Select Top 600 * from
( Select Top 2000 * from
( Select Top 2000 PermitNumber, HouseNumber, OnStreetName,
FromStreetName, ToStreetName, WorkStartDate as "WorkStart",
tbl_Permittee.Permittee_name as PermitteeName, PermitteeNumber,
PermitType_ID as "Type",
InspectionDistrict,
PermitStatus,
IssueDate

Quote:

Originally Posted by

>From PermitMain inner join tbl_Permittee


on PermitMain.PermitteeNumber = tbl_Permittee.Permittee_Number
and (tbl_Permittee.Permittee_name_flag = 'd' or
tbl_Permittee.Permittee_name_flag = 'p')
where
(PermitType_ID like '01%' ) and worktypeid is null
and ((IssueDate between @.IssueDateFrom and @.IssueDateTo) or
(EmergIssueDate between @.IssueDateFrom and @.IssueDateTo))
and PermitteeNumber = @.PermitteeNumber
and PermitMain.Boroughcode = @.Boro
order by WorkStart DESC
) as T2 order by WorkStart ASC

) as T3

) as T4 order by WorkStart DESC

THIS ONE RUNS FAST and RETURNS RESULTS.

The Other Select statement:

Select * from ( Select Top 600 * from
( Select Top 2000 * from
( Select Top 2000 PermitNumber, HouseNumber, OnStreetName,
FromStreetName, ToStreetName, WorkStartDate as "WorkStart",
tbl_Permittee.Permittee_name as PermitteeName, PermitteeNumber,
PermitType_ID as "Type",
InspectionDistrict,
PermitStatus,
IssueDate

Quote:

Originally Posted by

>From PermitMain inner join tbl_Permittee


on PermitMain.PermitteeNumber = tbl_Permittee.Permittee_Number
and (tbl_Permittee.Permittee_name_flag = 'd' or
tbl_Permittee.Permittee_name_flag = 'p')
where
(PermitType_ID like @.WorkTYPE ) and worktypeid is null
and ((IssueDate between @.IssueDateFrom and @.IssueDateTo) or
(EmergIssueDate between @.IssueDateFrom and @.IssueDateTo))

and PermitteeNumber = @.PermitteeNumber

and PermitMain.Boroughcode = @.Boro

order by WorkStart DESC

) as T2 order by WorkStart ASC

) as T3

) as T4 order by WorkStart DESC

TAKES FOREVER to COMPLETE.

However IF I INCREASE the PAGESIZE from 600 to 800, BOTH QUERIES RETURN
RESULTS EQUALLY FAST.

Thanks for your helpYou are right, I did not include the exact query since it has a whole

Quote:

Originally Posted by

of joins and many where clauses in it.


Can you *PLEASE* not start a new thread for every reply?

A|||On 26 Jan 2007 05:56:21 -0800, "rbg" <rbg.net@.gmail.comwrote:

Quote:

Originally Posted by

>Select * from ( Select Top 600 * from


...

Quote:

Originally Posted by

>(PermitType_ID like '01%' ) and worktypeid is null


...

Quote:

Originally Posted by

>THIS ONE RUNS FAST and RETURNS RESULTS.


Quote:

Originally Posted by

>The Other Select statement:
>
>Select * from ( Select Top 600 * from


...

Quote:

Originally Posted by

>(PermitType_ID like @.WorkTYPE ) and worktypeid is null


...

Quote:

Originally Posted by

>TAKES FOREVER to COMPLETE.


Quote:

Originally Posted by

>However IF I INCREASE the PAGESIZE from 600 to 800, BOTH QUERIES RETURN
>RESULTS EQUALLY FAST.


Seems incredibly unlikely that the 600/800 would make a difference.

My guess would be that the "like @.variable" can't know in advance that
the value will be single and have only a trialing wildcard, so it does
a scan instead of using the index. This uses a lot more of both CPU
and diskio. This would make it more sensitive to contention from
other system activities. Are you sure there was nothing else running
on the system when you were doing the comparisons?

J.