Hi all:

When using SQL, I can select some wanted records by
Code:
SELECT
    OneColumn,
    COUNT(*)
FROM
    OneTable
WHERE
    OneColumn IN(value1,value2,value3)
GROUP BY
    OneColumn
Now I try to use MDX to rewrite it, the basic MDX is:
Code:
SELECT
	{([Time].[2007], [NumberUser], [TrunkOut])} on rows,
	{[Measures].[CallCount], [Measures].[CallDuration], [Measures].[Charge], [Measures].[Fee]} on columns
FROM
	CallCube
For this instance, I'm calculating the fee of caller from telephone call logs, but I only need to care about the call which dialed out via specified trunks/lines(eg IPTrunk1,IPTrunk2,IPTrunk3 etc), because the telephone calls via other thunks/lines are free.

Now I using a 'WITH MEMBER' MDX clause to simulate the 'WHERE conditions' SQL clause:
Code:
--WITH SET [移动IP线路] AS '{[TrunkOut].[移动IP-1], [TrunkOut].[移动IP-2], [TrunkOut].[移动IP-3]}'
WITH MEMBER [TrunkOut].[IPTrunksFromChinaMobile] AS '[TrunkOut].[移动IP-1] + [TrunkOut].[移动IP-2] + [TrunkOut].[移动IP-3]'
SELECT
	{([Time].[2007], [NumberUser], [TrunkOut].[IPTrunksFromChinaMobile])} on rows,
	 -- FILTER([TrunkOut].MEMBERS,[TrunkOut].CurrentMember IN {[TrunkOut].[移动IP-1],[TrunkOut].[移动IP-2],[TrunkOut].[移动IP-3]})}
	{[Measures].[CallCount], [Measures].[CallDuration], [Measures].[Charge], [Measures].[Fee]} on columns
FROM
	CallCube
This can filter the 3 trunks/lines I wanted, but, I can only get a ALL/TOTAL fee of the 3 trunks, I can't get the fee of each trunk.

How can I select part members of a dimension by a MDX query (not by define a new dimension in Schema file) ?

Thanks !
sorry for my poor english.


the mondrian Schema file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<Schema name="CallLogSchema">
	<!-- 华为 CC08B 话费统计 -->
	<Cube name="CallCube" caption="华为 CC08B 话费统计 Cube">
		<Table name="HuaweiCC08BCallLog"/>

		<Dimension name="TrunkIn" foreignKey="TrunkNOIn" caption="入�*继">
			<Hierarchy hasAll="true" primaryKey="ID" allMemberName="所有入�*继 (Member)" allLevelName="所有入�*继(Level)">
				<!--
				<Table name="VIEW_Trunks" alias="TrunkIn"/>
				-->
				<View alias="TrunkIn">
					<SQL dialect="mssql">SELECT ID, RTRIM(sTkGrpName) AS Name FROM CC08BAM.Bam.dbo.tbl_TrunkGroup</SQL>
				</View>
				<Level name="TrunkIn" caption="入�*继名称" column="ID" nameColumn="Name" uniqueMembers="true" type="String"/>
				<!--
					<NameExpression>
						<SQL dialect="mssql">sTkGrpName</SQL>
					</NameExpression>
				</Level>
				-->
			</Hierarchy>
		</Dimension>

		<Dimension name="TrunkOut" foreignKey="TrunkNOOut" caption="出�*继">
			<Hierarchy hasAll="true" primaryKey="ID" allMemberName="所有出�*继 (Member)" allLevelName="所有出�*继 (Level)">
				<!--
				<Table name="VIEW_Trunks" alias="TrunkOut"/>
				-->
				<View alias="TrunkOut">
					<SQL dialect="mssql">SELECT ID, RTRIM(sTkGrpName) AS Name FROM CC08BAM.Bam.dbo.tbl_TrunkGroup</SQL>
				</View>
				<Level name="TrunkOut" caption="出�*继名称" column="ID" nameColumn="Name" uniqueMembers="true" type="String"/>
				<!--
					<NameExpression>
						<SQL dialect="mssql">sTkGrpName</SQL>
					</NameExpression>
				</Level>
				-->
			</Hierarchy>
		</Dimension>

		<!--
		<Dimension name="SP" foreignKey="ID" caption="运营商">
			<Hierarchy hasAll="true" primaryKey="ID" allMemberName="所有运营商 (Member)" allLevelName="所有运营商 (Level)">
				<Table name="SP"/>
				<Level name="SP" caption="运营商名称" column="ID" uniqueMembers="true">
					<NameExpression>
						<SQL dialect="mssql">Name</SQL>
					</NameExpression>
				</Level>
			</Hierarchy>
		</Dimension>
		-->

		<Dimension name="NumberUser" foreignKey="ANI" caption="主叫用户">
			<Hierarchy hasAll="true" primaryKey="ANI" allMemberName="所有主叫用户 (Member)" allLevelName="所有主叫用户 (Level)">
				<Table name="NumberUser"/>
				<Level name="NumberUser" caption="主叫用户" column="ANI" uniqueMembers="true" type="String">
					<!--
					<NameExpression>
						<SQL dialect="mssql">ANI</SQL>
					</NameExpression>
					-->
				</Level>
			</Hierarchy>
		</Dimension>

		<!--
		<Dimension name="TrunkUser" foreignKey="ID" caption="专线用户">
			<Hierarchy hasAll="true" primaryKey="ID" allMemberName="所有专线用户 (Member)" allLevelName="所有专线用户 (Level)">
				<Table name="TrunkUser"/>
				<Level name="TrunkUser" caption="专线用户" column="ID" uniqueMembers="true">
					<NameExpression>
						<SQL dialect="mssql">Name</SQL>
					</NameExpression>
				</Level>
			</Hierarchy>
		</Dimension>
		-->

		<Dimension name="Time" type="TimeDimension" caption="呼叫时间">
			<Hierarchy hasAll="true" allMemberName="所有时间(Member)" allLevelName="所有时间(Level)">
				<Level name="Year" caption="年" column="CallBeginTime" levelType="TimeYears" uniqueMemebers="true">
					<KeyExpression>
						<SQL dialect="mssql">DATEPART(YEAR, CallBeginTime)</SQL>
					</KeyExpression>
				</Level>
				<Level name="Month" caption="月" column="CallBeginTime" levelType="TimeMonths" uniqueMemebers="false">
					<KeyExpression>
						<SQL dialect="mssql">DATEPART(MONTH, CallBeginTime)</SQL>
					</KeyExpression>
				</Level>
				<!--
				<Level name="Day" caption="日" column="CallBeginTime" levelType="TimeDays" uniqueMemebers="false">
					<KeyExpression>
						<SQL dialect="mssql">DATEPART(DAY, CallBeginTime)</SQL>
					</KeyExpression>
				</Level>
				-->
			</Hierarchy>
		</Dimension>

		<Measure name="CallCount" column="CallLogID" datatype="Integer" aggregator="count" formatString="########" />
		<Measure name="CallDuration" column="CallDuration" datatype="Integer" aggregator="sum" formatString="########" />
		<Measure name="Charge" column="Charge" datatype="Integer" aggregator="sum" formatString="########" />
		<Measure name="Fee" datatype="Numeric" aggregator="sum" formatString="########.00">
			<MeasureExpression>
				<SQL dialect="mssql">
					(CASE WHEN LEFT(DNIS,3)='980' THEN Charge*0.15 WHEN DNIS LIKE '98%' THEN Charge*0.10 ELSE 0 END)
				</SQL>
			</MeasureExpression>
		</Measure>
		<!--
		<CalculatedMember name="Fee" dimension="Measure" formula="">
		</CalculatedMember>
		-->
	</Cube>
</Schema>