jaee83


hi,can someone help in finding the error in this mdx query for the given problem statement.

Query : Sales performance by gender of the customers.

- The expected output is 2 values of sales ,one for all male customers and other for all female customers.

- The level CustomerID of dimension Customer has attribute GENDER.

- I have calculated two sets [Male] and [Female] .

- At present i am getting sales value for all the members ,i want one aggregated value for male set and another value for female set.How do i go about doing this Please help.

MDX Query :

WITH set [Male] AS 'Filter ([Customer].[CustomerID].Members,[Customer].CurrentMember.Properties("GENDER")= "M")'
set [Female] AS 'Filter ([Customer].[CustomerID].Members,[Customer].CurrentMember.Properties("GENDER")= "F")'

SELECT {[Measures].[SALES($)]} ON AXIS(0), {[Male],[Female]} ON AXIS(1) FROM [cubename]




Re: Problem in MDX query for calculating total sales.

Irina Gorbach


Something like this (just check the syntax, I was simply typing)

WITH set [Male] AS 'Filter ([Customer].[CustomerID].Members,[Customer].CurrentMember.Properties("GENDER")= "M")'
set [Female] AS 'Filter ([Customer].[CustomerID].Members,[Customer].CurrentMember.Properties("GENDER")= "F")'
member Customer.AggMale as 'Aggregate([Male])
member Customer.AggFemale as 'Aggregate([Female])

SELECT {[Measures].[SALES($)]} ON AXIS(0), {Customer.AggMale,Customer.AggFemale} ON AXIS(1) FROM [cubename]








Re: Problem in MDX query for calculating total sales.

jaee83

thanku very much Irina .It wrked exactly the way i wanted !!