dbTalk Databases Forums  

Filter,Slicer

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


Discuss Filter,Slicer in the microsoft.public.sqlserver.olap forum.



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

Default Filter,Slicer - 06-01-2005 , 10:58 AM






First off, I'm new to MDX and I have a lot to learn.

My problem is related to filtering/slicing. I have a query like the
following:

SELECT

NON EMPTY
{[Measures].[Approved], [Measures].[Submitted]} ON COLUMNS,
{[Billing Code Description].[Description].Members} ON ROWS

FROM Claims_FT

WHERE
([Jurisdiction].[All Jurisdiction].[State])

The above query works great. Howevery, my users want to filter the results
on more than one member of jurisdiction (like a list of 5-10 counties) Any
thoughts or ideas on how I can filter on a list of members from the
jurisdiction dimension?

Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Filter,Slicer - 06-01-2005 , 07:18 PM






When using AS 2000, typically an Aggregate() calculated member is
created. This won't work with Distinct Counts:

Quote:
With
Set [CountySet] as
'{[Jurisdiction].[County1], [Jurisdiction].[County2]}'
Member [Jurisdiction].[All Jurisdiction].[SelectedCounties] as
'Aggregate([CountySet])'

SELECT

NON EMPTY
{[Measures].[Approved], [Measures].[Submitted]} ON COLUMNS,
{[Billing Code Description].[Description].Members} ON ROWS

FROM Claims_FT

WHERE
([Jurisdiction].[All Jurisdiction].[SelectedCounties])
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


Reply With Quote
  #3  
Old   
Hector_C
 
Posts: n/a

Default RE: Filter,Slicer - 06-26-2005 , 02:33 PM



I have the kind of the Same Problem,

I have an MDX Query there I need to Get Some Meassures (Colums) and use a
Region Dimension with cross joins a set of Time Dimension Tuples for Row.
It goes like this using the FoodMart 2000 db and the Sales Cube

//Example 1
Select
{[Measures].[Unit Sales]} on Columns,
{CrossJoin({[Store].[All Stores].[USA].[WA]},{[Time].[1997].[Q1],
[Time].[1997].[Q2]})} on rows
From Sales

I belive that want the result for a particular cell to be containing only
some spesific counties, I have used a Memeber to obtain that result.

//Example 2
With Member [Store].[CountyList] as '[Store].[All
Stores].[USA].[WA].[Bellingham]+[Store].[All Stores].[USA].[WA].[Seattle]'
Select
{[Measures].[Unit Sales]} on Columns,
{CrossJoin({[Store].[CountyList]},{[Time].[1997].[Q1], [Time].[1997].[Q2]})}
on rows
From Sales

on the First Example you get the Meassure Unit Sales from All Seattle
Stores and cross joinined with Q1 and Q2 1997.

But if you want the same timeframes but some determinated stores (Counties
in you example) you can create a Member and use it instead like in Example 2.

However, I still need to create a Slicer Dimension form a Set of Tuples,
This I have not bee able to do since I get an Error on the Sample Aplication.

//Example 3
With Member [Store].[CountyList] as '[Store].[All
Stores].[USA].[WA].[Bellingham]+[Store].[All Stores].[USA].[WA].[Seattle]'
Select
{[Measures].[Unit Sales]} on Columns,
{CrossJoin({[Store].[CountyList]},{[Time].[1997].[Q1], [Time].[1997].[Q2]})}
on rows
From Sales
Where {([Product].[All Products].[Drink].[Alcoholic Beverages]),
([Product].[All Products].[Food].[Baked Goods])}

My Concern is that in the MSDN support page you can find documentation that
states that the Slicer Dimension supports only one Tuple, it also says that
you may specified a set of tuples and it should resolve the set ussing
agregations, if it can't will give an error. But the sample code is the same
and I still get an Error. I hope some can help me with setting a Set of
Tuples in the Slicer Dimension.

--
Sincerely
Hector C


"Hossy" wrote:

Quote:
First off, I'm new to MDX and I have a lot to learn.

My problem is related to filtering/slicing. I have a query like the
following:

SELECT

NON EMPTY
{[Measures].[Approved], [Measures].[Submitted]} ON COLUMNS,
{[Billing Code Description].[Description].Members} ON ROWS

FROM Claims_FT

WHERE
([Jurisdiction].[All Jurisdiction].[State])

The above query works great. Howevery, my users want to filter the results
on more than one member of jurisdiction (like a list of 5-10 counties) Any
thoughts or ideas on how I can filter on a list of members from the
jurisdiction dimension?

Reply With Quote
  #4  
Old   
Hector_C
 
Posts: n/a

Default Re: Filter,Slicer - 06-26-2005 , 04:07 PM



Hi,

I posted another answer for the question with a work around, however, I
review your code with detail and finally understand what I needed to to. Now
I have Created one set for each Dimension and then create a agregated Member
for each Dimension and use thoese members in the Slicer Dimension.

Thanks a lot for the example you provide, it was really helpful.

--
Sincerely
Hector C


"Deepak Puri" wrote:

Quote:
When using AS 2000, typically an Aggregate() calculated member is
created. This won't work with Distinct Counts:


With
Set [CountySet] as
'{[Jurisdiction].[County1], [Jurisdiction].[County2]}'
Member [Jurisdiction].[All Jurisdiction].[SelectedCounties] as
'Aggregate([CountySet])'

SELECT

NON EMPTY
{[Measures].[Approved], [Measures].[Submitted]} ON COLUMNS,
{[Billing Code Description].[Description].Members} ON ROWS

FROM Claims_FT

WHERE
([Jurisdiction].[All Jurisdiction].[SelectedCounties])



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


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.