## Calculated Member - MDX Count

### Calculated Member - MDX Count

How do you create a calculated measure that returns the count of fact table
records that matches a specific dimension table hierarchy? Can an example
MDX syntax be provided?

Thanks!

### Calculated Member - MDX Count

Hi Sandy,

MDX command queries the cells inside the cube. It won't go to the source
fact table and dimension table unless you send a "drillthrough" command.

This posting is provided 'AS IS' with no warranties, and confers no rights.

Regards,
Haiwei Xu

### Calculated Member - MDX Count

Thanks Haiwei,

I don't think I was clear enough in my question. I basically want to create
a calculated member that is a ratio:

1. A simple example is if I divide a simple measure by another. This is
simple.

2. What I am trying to achieve is the following calculated member:

Numerator = Counts of Measure X belonging to dimension Y member.
Denominator = Total Count of Measure X.

For example, take fruit as a fact table (orange, apple pear etc.) and fruit
types as a dimension containing type 'citrus'. How can I create a calculated
member that gives the ratio of citrus fruits to total fruits?

Calculated Member = count(citrus fruits)/count(all fruits)

Thanks
Sandy

Quote:> Hi Sandy,

> MDX command queries the cells inside the cube. It won't go to the source
> fact table and dimension table unless you send a "drillthrough" command.

> This posting is provided 'AS IS' with no warranties, and confers no
rights.

> Regards,
> Haiwei Xu

### Calculated Member - MDX Count

[Measures].[Fruit Count] / ( [Measures].[Fruit Count], [Fruit].[All Fruit] )

> Thanks Haiwei,

> I don't think I was clear enough in my question. I basically want to create
> a calculated member that is a ratio:

> 1. A simple example is if I divide a simple measure by another. This is
> simple.

> 2. What I am trying to achieve is the following calculated member:

> Numerator = Counts of Measure X belonging to dimension Y member.
> Denominator = Total Count of Measure X.

> For example, take fruit as a fact table (orange, apple pear etc.) and fruit
> types as a dimension containing type 'citrus'. How can I create a calculated
> member that gives the ratio of citrus fruits to total fruits?

> Calculated Member = count(citrus fruits)/count(all fruits)

> Thanks
> Sandy

> > Hi Sandy,

> > MDX command queries the cells inside the cube. It won't go to the source
> > fact table and dimension table unless you send a "drillthrough" command.

> > This posting is provided 'AS IS' with no warranties, and confers no
> rights.

> > Regards,
> > Haiwei Xu

--
George Spofford
Microsoft MVP
Chief Architect / OLAP Solution Provider
DSS Lab
http://www.dsslab.com

ISVs & IT organizations: Find out how DSS Lab can speed your development!

### Calculated Member - MDX Count

Thanks!

> [Measures].[Fruit Count] / ( [Measures].[Fruit Count], [Fruit].[All
Fruit] )

> > Thanks Haiwei,

> > I don't think I was clear enough in my question. I basically want to
create
> > a calculated member that is a ratio:

> > 1. A simple example is if I divide a simple measure by another. This is
> > simple.

> > 2. What I am trying to achieve is the following calculated member:

> > Numerator = Counts of Measure X belonging to dimension Y member.
> > Denominator = Total Count of Measure X.

> > For example, take fruit as a fact table (orange, apple pear etc.) and
fruit
> > types as a dimension containing type 'citrus'. How can I create a
calculated
> > member that gives the ratio of citrus fruits to total fruits?

> > Calculated Member = count(citrus fruits)/count(all fruits)

> > Thanks
> > Sandy

> > > Hi Sandy,

> > > MDX command queries the cells inside the cube. It won't go to the
source
> > > fact table and dimension table unless you send a "drillthrough"
command.

> > > This posting is provided 'AS IS' with no warranties, and confers no
> > rights.

> > > Regards,
> > > Haiwei Xu

> --
> George Spofford
> Microsoft MVP
> Chief Architect / OLAP Solution Provider
> DSS Lab
> http://www.dsslab.com

> ISVs & IT organizations: Find out how DSS Lab can speed your development!