Showing posts with label named. Show all posts
Showing posts with label named. Show all posts

Wednesday, March 21, 2012

Getting rid of the "All" level in query results

I have two seemingly identical cubes, one imported from AS 2000 and one
created using AMO in AS 2000 (they are both named new1 and are located in
separate databases). Yet, when issuintg the following simple query:
select {[RecvPay].[RecvPay].members} on columns from new1
I get only columns 1 and 2 on the imported cube, while I get an additional
"All RecvPay" column on the created cube. I have scoured the XMLA script
generated from each RecvPay dimension and how it is used in the new1 cube
without seeing any meaningful differences. I want to get rid of this "All
RecvPay" in my results. Am I missing something?

Thanks,
Boris Zakharin, MCAD
Metavante Risk and Compliance Solutions

You could just use select {[RecvPay].[RecvPay].Children} on columns from new1

|||I understand there are other ways to get it, but why the difference?
|||

There is an IsAggregatable property on each attribute which sets if it generates this automatic All member. If you don't want an All member in the attribute at all you can change this setting from the default of "true" to false. If you had the all member turned off in AS2000, this setting was probably kept when you migrated, if you generated the dimension in AMO without overriding the defaults, then it would automatically generate an All member.

If you only want the All member excluded from the query then there is a slight change in naming between AS2000 and AS2005. AS 2000 uses a <dimension>.<level>.members syntax, and was not truely multi-hierarchy aware. AS2005 is truely multi hierarchy aware and you need to use <dimension>.<hierarchy>.<level>.members. When you create an attritube it generates an implied single level hierarchy.

|||Thank you. I'll try it first thing tomorrow
|||

That does work in my example (and in the much more complicated originsl query this came from), but that is definitely not how the 2000 dimension was constructed since I can see "All RecvPay" when browsing that dimension. I am just wondering whether other queries might fail or produce unexpected results with this change.

|||

In this case, the difference in you queries is most likely explained by the fact that in SSAS 2005 you need to specify the heirarchy in the member/level references.

In AS 2000 [RecvPay].[RecvPay] refers to the RecvPay level of the RecvPay dimension

In AS 2005 [RecvPay].[RecvPay] refers to the RecvPay hierarchy of the RecvPay dimension

When you get the members of an entire hierarchy it includes the All member. To refer to just the level of RecvPay members (which does not include the all member) you need to use a [RecvPay].[RecvPay].[RecvPay] reference.

Getting rid of the "All" level in query results

I have two seemingly identical cubes, one imported from AS 2000 and one
created using AMO in AS 2000 (they are both named new1 and are located in
separate databases). Yet, when issuintg the following simple query:
select {[RecvPay].[RecvPay].members} on columns from new1
I get only columns 1 and 2 on the imported cube, while I get an additional
"All RecvPay" column on the created cube. I have scoured the XMLA script
generated from each RecvPay dimension and how it is used in the new1 cube
without seeing any meaningful differences. I want to get rid of this "All
RecvPay" in my results. Am I missing something?

Thanks,
Boris Zakharin, MCAD
Metavante Risk and Compliance Solutions

You could just use select {[RecvPay].[RecvPay].Children} on columns from new1

|||I understand there are other ways to get it, but why the difference?
|||

There is an IsAggregatable property on each attribute which sets if it generates this automatic All member. If you don't want an All member in the attribute at all you can change this setting from the default of "true" to false. If you had the all member turned off in AS2000, this setting was probably kept when you migrated, if you generated the dimension in AMO without overriding the defaults, then it would automatically generate an All member.

If you only want the All member excluded from the query then there is a slight change in naming between AS2000 and AS2005. AS 2000 uses a <dimension>.<level>.members syntax, and was not truely multi-hierarchy aware. AS2005 is truely multi hierarchy aware and you need to use <dimension>.<hierarchy>.<level>.members. When you create an attritube it generates an implied single level hierarchy.

|||Thank you. I'll try it first thing tomorrow
|||

That does work in my example (and in the much more complicated originsl query this came from), but that is definitely not how the 2000 dimension was constructed since I can see "All RecvPay" when browsing that dimension. I am just wondering whether other queries might fail or produce unexpected results with this change.

|||

In this case, the difference in you queries is most likely explained by the fact that in SSAS 2005 you need to specify the heirarchy in the member/level references.

In AS 2000 [RecvPay].[RecvPay] refers to the RecvPay level of the RecvPay dimension

In AS 2005 [RecvPay].[RecvPay] refers to the RecvPay hierarchy of the RecvPay dimension

When you get the members of an entire hierarchy it includes the All member. To refer to just the level of RecvPay members (which does not include the all member) you need to use a [RecvPay].[RecvPay].[RecvPay] reference.

Monday, March 12, 2012

Getting only active records

I have a report that lists companies from a table. I want to be able to
print either active, inactive or all records. The table has a field named
InactiveDate and if it is null the company is active. How can I setup
report parameter(s) to get just active, just inactive, or all? Thanks.
DavidOn Mar 8, 11:41 am, "David" <dlch...@.lifetimeinc.com> wrote:
> I have a report that lists companies from a table. I want to be able to
> print either active, inactive or all records. The table has a field named
> InactiveDate and if it is null the company is active. How can I setup
> report parameter(s) to get just active, just inactive, or all? Thanks.
> David
What version of SSRS are you using?|||On Mar 9, 6:41 am, "David" <dlch...@.lifetimeinc.com> wrote:
> I have a report that lists companies from a table. I want to be able to
> print either active, inactive or all records. The table has a field named
> InactiveDate and if it is null the company is active. How can I setup
> report parameter(s) to get just active, just inactive, or all? Thanks.
> David
You can set up a stored procedure to accept a parameter @.Status and
return the list of data based on this.
E.g 0 for All, 1 for Active, 2 for Inactive
When you point your dataset to this stored proc, the parameter will
automatically be added to your report. Then set up this parameter to
come from a non-queried list and type in appropriate values to pass to
the stored procedure as above: Name: All, Value: 0; Name: Active,
Value: 1; Name:Inactive, Value: 3;
Rowen|||Thank you, that worked great. We are using SQL 2005.
David
"Rowen" <rowenmcd@.gmail.com> wrote in message
news:1173407563.877928.216060@.p10g2000cwp.googlegroups.com...
> On Mar 9, 6:41 am, "David" <dlch...@.lifetimeinc.com> wrote:
>> I have a report that lists companies from a table. I want to be able to
>> print either active, inactive or all records. The table has a field
>> named
>> InactiveDate and if it is null the company is active. How can I setup
>> report parameter(s) to get just active, just inactive, or all? Thanks.
>> David
> You can set up a stored procedure to accept a parameter @.Status and
> return the list of data based on this.
> E.g 0 for All, 1 for Active, 2 for Inactive
> When you point your dataset to this stored proc, the parameter will
> automatically be added to your report. Then set up this parameter to
> come from a non-queried list and type in appropriate values to pass to
> the stored procedure as above: Name: All, Value: 0; Name: Active,
> Value: 1; Name:Inactive, Value: 3;
> Rowen
>