dbTalk Databases Forums  

Named sets in Analysis Manager different than WITH

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Named sets in Analysis Manager different than WITH in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Rick Razzano
 
Posts: n/a

Default Named sets in Analysis Manager different than WITH - 07-17-2004 , 10:29 AM






I have a situation where I am using a named set with the following
definition:

SET [Top 25 Companies] AS 'TopCount([Client].[Company Name].Members,
25, [Measures].[Sales])'

I'm just retreiving the top 25 client companies by name. When I use
WITH to define the set, I get the set of 25 companies which have the
highest sales in the tuple that I am selecting. So far so good.

When I create the named set in Analysis Manager, the set always
retrieves the top 25 companies for the entire cube, not the tuple in
my particular query.

Example:
WITH
SET [Top 25 Companies] AS 'TopCount([Client].[Company Name].Members,
25, [Measures].[Sales])'
SELECT
{ [Measures].[Sales] } ON 0,
{ [Top 25 Companies] } ON 1
WHERE [Sale Date].[2001]

This will return the companies who have the highest sales in 2001

Now let's say [Top 25 Companies] is created in Analysis Manager:
SELECT
{ [Measures].[Sales] } ON 0,
{ [Top 25 Companies] } ON 1
WHERE [Sale Date].[2001]

This will return the companies who have the highest sales across all
years, and then show the sales for those companies in 2001 (some of
which come back with 0). This is not what I want.

I need to be able to create the named set for use in a 3rd party
package, but I want it to work like the query-scoped (i.e., WITH
SET...) set. Is this possible? What am I missing?

Thanks,
Rick

Reply With Quote
  #2  
Old   
Dave Wickert [MSFT]
 
Posts: n/a

Default Re: Named sets in Analysis Manager different than WITH - 07-21-2004 , 01:11 PM






Named sets can either be created as a DSO Command object, in which case they
are automatically executed when the session starts (as Jamie pointed out)
and are not dependent on any query itself -- they will run regardless of the
query -- or a front-end tool can execute them in session scope, which is
what Rick is asking for. Unfortunately to do the later requires support from
the front-end tool itself, i.e. that it queries some metadata somewhere and
execute each named set in session scope. This isn't something that the
server will do for them automatically. Sorry.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Jamie" <Jamie (AT) discussions (DOT) microsoft.com> wrote

Quote:
I don't think this is possible. As far as I know Named Sets are evaluaed
whenever a connection is made to the cube and therefore cannot be
query-sensitive.
Quote:
I see your problem - its annoying but there you are.

Regards
Jamie


"Rick Razzano" wrote:

I have a situation where I am using a named set with the following
definition:

SET [Top 25 Companies] AS 'TopCount([Client].[Company Name].Members,
25, [Measures].[Sales])'

I'm just retreiving the top 25 client companies by name. When I use
WITH to define the set, I get the set of 25 companies which have the
highest sales in the tuple that I am selecting. So far so good.

When I create the named set in Analysis Manager, the set always
retrieves the top 25 companies for the entire cube, not the tuple in
my particular query.

Example:
WITH
SET [Top 25 Companies] AS 'TopCount([Client].[Company Name].Members,
25, [Measures].[Sales])'
SELECT
{ [Measures].[Sales] } ON 0,
{ [Top 25 Companies] } ON 1
WHERE [Sale Date].[2001]

This will return the companies who have the highest sales in 2001

Now let's say [Top 25 Companies] is created in Analysis Manager:
SELECT
{ [Measures].[Sales] } ON 0,
{ [Top 25 Companies] } ON 1
WHERE [Sale Date].[2001]

This will return the companies who have the highest sales across all
years, and then show the sales for those companies in 2001 (some of
which come back with 0). This is not what I want.

I need to be able to create the named set for use in a 3rd party
package, but I want it to work like the query-scoped (i.e., WITH
SET...) set. Is this possible? What am I missing?

Thanks,
Rick




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.