first, knowledge of mdx limited
basically, have 2 queries; 1 hq sales per departments , 1 stock room sales per departments. return results of department sales of stock room followed department sales of hq in 1 go.
thanks in advance.
in sql, query should this:
select stockroom.code, stockroom.sales, stockroom.department, stockroom.hq , (select sum(hq.sales) stockroom hq hq.department = stockroom.department , hq.hq = stockroom.hq) hqsales stockroom stockroom week = 12 , year = 2011 , code = 'c001'
edit: i'm working on olap cube using sql server reporting services (visual studio 2k8r2). here current mdx query:
select non empty { [measures].[cattc], [measures].[cattc n-1], [measures].[prog] } on columns , non empty { ([stock room].[stock room class enseigne].[stock room class enseigne].allmembers * [stock room].[stock room geographical dynamic hierarchy].[stock room].allmembers * [product].[product hierarchy].[product main class level 3].allmembers ) } dimension properties member_caption, member_unique_name on rows ( select ( strtoset(@timecalendartimecalendarweekofyear, constrained) ) on columns ( select ( strtoset(@timecalendartimecalendaryear, constrained) ) on columns ( select ( strtoset(@stockroomstockroomcode, constrained) ) on columns [customnexttest]))) ( iif( strtoset(@stockroomstockroomcode, constrained).count = 1, strtoset(@stockroomstockroomcode, constrained), [stock room].[stock room code].currentmember ) , iif( strtoset(@timecalendartimecalendaryear, constrained).count = 1, strtoset(@timecalendartimecalendaryear, constrained), [time calendar].[time calendar year].currentmember ) , iif( strtoset(@timecalendartimecalendarweekofyear, constrained).count = 1, strtoset(@timecalendartimecalendarweekofyear, constrained), [time calendar].[time calendar week of year].currentmember ) ) cell properties value, back_color, fore_color, formatted_value, format_string, font_name, font_size, font_flags
Comments
Post a Comment