Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 9th, 2007, 11:10 AM
Registered User
 
Join Date: Mar 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem in calculating total sales in MDX query

hi,can someone please 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]





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with the parameter date in a mdx query olmouy SQL Language 0 May 30th, 2007 05:32 AM
calculating grand total blkskullwork Javascript 2 December 18th, 2006 10:36 AM
Calculating total form! require assistance Neeko Java Basics 1 May 4th, 2006 06:48 AM
Running MDX Query from crystal reports syedjavid Crystal Reports 1 August 23rd, 2004 06:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.