Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sum in mdx statement

Status
Not open for further replies.

craig322

MIS
Apr 19, 2001
108
US
I am trying to write an mdx statement that will show me the sum of each group's (a dimension level) sales amount across all the years of the cube.

I thought the following would work but I am only getting the current year.

SELECT {[Measures].[Sales]} on columns,
[Organization].[Group Name].Members on rows
FROM [Daily Sales]

If I were writing the SQL, it would be

SELECT group_name, sum(sales)
FROM my_table
GROUP BY group_name

Any help would be greatly appreciated as I am new to MDX

TIA
 
craig,

You need to do a crossjoin().

Select CROSSJOIN([Date].[Year].Members,{[Measures].[Sales]} on COLUMNS,
[Organization].[Group Name].Members on ROWS
FROM [Daily Sales]

hope this helps.

Justin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top