SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Counting Distinct IDs from two sets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

DP978
Constraint Violating Yak Guru

USA
269 Posts

Posted - 03/09/2012 :  10:02:50  Show Profile  Send DP978 an AOL message  Click to see DP978's MSN Messenger address  Reply with Quote
Hi all,

I have two sets I need to create and then union to count distinct IDs. The premise is this, Set A is for Condition 1 and Set B is for condition 2. We have an ID attribute and there are a lot of filters neccesary to figure out the sets. My question is how can I generate a set that contains on IDs but filters on critera. Example of set A:

WITH

//Set one members who had a service listed in table CDC-J
SET [A] AS
(
Except
(
{[Member].[Member].MEMBERS}
,[Member].[Member].DefaultMember
)

, [Member].[Is Diabetic].&[Y]
,[Member].[Has Continuous Enrollment].&[Y]
,{
[Member].[RC].&[RC1]
,[Member].[RC].&[RC2]
}
,{[Member].[Age Years].&[18] : [Member].[Age Years].&[75]}
,[Service].[Table Key].&[CDC-J]
,[Service Date].[Year].&[2010]
)

SET [B] AS
(
Except
(
{[Member].[Member].MEMBERS}
,[Member].[Member].DefaultMember
)

, [Member].[Is Diabetic].&[Y]
,[Member].[Has Continuous Enrollment].&[Y]
,{
[Member].[RC].&[RC1]
,[Member].[RC].&[RC2]
}
,{[Member].[Age Years].&[18] : [Member].[Age Years].&[75]}
,[Service].[Table Key].&[CDC-K]
,[Service Date].[Year].&[2010]
)

Note that here the sets bring in tuples which are not unique, I want to only bring in Member].[Member].MEMBERS. I hope this question makes sense. Thanks for any and all help!
-Derek

  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000