sql - SSAS -> MDX -> How to create a query that returns a topcount by a date period i.e. week? -
sql - SSAS -> MDX -> How to create a query that returns a topcount by a date period i.e. week? -
i have received recent request create query returns top 100 customers revenue per week. can , homecoming top 100 customers whole when add together in week attribute, query times out. wondering if out there has run or has been able produce comparable query?
my query works without week present. :
select non empty { [measures].[revenue] } on columns, non empty topcount ( { ([customer].[customer id].[customer id].allmembers * [customer].[name].[name].allmembers ) }, 100, [measures].[revenue]) on rows [dw]
my query week nowadays times out completely. :
select non empty { [measures].[revenue] } on columns, non empty topcount ( { ([customer].[customer id].[customer id].allmembers * [customer].[name].[name].allmembers * [date link].[week].[week].allmembers ) }, 100, [measures].[revenue]) on rows [dw]
wouldn't give top 100 customers , week top in? client in 1st position in week one, 5th position in week two, , on, you'd 100 rows in total not 100 per week?
try like
select non empty { [measures].[revenue] } on columns, non empty { [date link].[week].[week].allmembers * { topcount ( { ([customer].[customer id].[customer id].allmembers * [customer].[name].[name].allmembers ) }, 100, [measures].[revenue]) } } on rows [dw]
i think may need utilize generate instead of * week members, can't remember , trying off top of head ;)
sql sql-server sql-server-2012 ssas mdx
Comments
Post a Comment