dbTalk Databases Forums  

Comp Sales in MDX

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Comp Sales in MDX in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Carmen
 
Posts: n/a

Default Comp Sales in MDX - 11-21-2003 , 07:12 AM






Fairly new to MDX.
I am trying to show comp sales, i.e. the measures for all
stores opened for more than 1 year.

I was able to produce the filter as follows:

WITH SET [Comparative Stores] as
'FILTER( [Store].[Standard].[Store].Members, Format
([Store].[Standard].CurrentMember.Properties("Store Start
Date"),"yyyymmdd") < Format(dateadd("d",-365,now
()),"yyyymmdd"))'

What I would like is something like:
SELECT
{ [Measures].Members } on columns ,
{ [Time] } on rows
FROM [Sales Planning]
WHERE { [Comparative Stores] }

But I get the following error:
Unable to open cellset. Formula error - cannot convert set
to Tuple - in the { ... } function.

I guess my set [Comparative Stores] generated by the
filter has a problem.

What am I doing wrong? Should I take a completely
different approach?


Reply With Quote
  #2  
Old   
Tom Chester
 
Posts: n/a

Default Re: Comp Sales in MDX - 11-21-2003 , 10:53 AM






Carmen, the WHERE clause has syntax problem plus logic problem. One and only
one member per dimension can participate in where clause. And no set braces.
You need to create a calc that sums the set, then slice by the calc.
Something like this:

WITH
Set MySet AS ' Filter(...) '
Member Store.AggSet AS
' Aggregate(MySet) '
SELECT
etc...
WHERE (Store.[AggSet])

tom @ the domain below
www.tomchester.net


"Carmen" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Fairly new to MDX.
I am trying to show comp sales, i.e. the measures for all
stores opened for more than 1 year.

I was able to produce the filter as follows:

WITH SET [Comparative Stores] as
'FILTER( [Store].[Standard].[Store].Members, Format
([Store].[Standard].CurrentMember.Properties("Store Start
Date"),"yyyymmdd") < Format(dateadd("d",-365,now
()),"yyyymmdd"))'

What I would like is something like:
SELECT
{ [Measures].Members } on columns ,
{ [Time] } on rows
FROM [Sales Planning]
WHERE { [Comparative Stores] }

But I get the following error:
Unable to open cellset. Formula error - cannot convert set
to Tuple - in the { ... } function.

I guess my set [Comparative Stores] generated by the
filter has a problem.

What am I doing wrong? Should I take a completely
different approach?




Reply With Quote
  #3  
Old   
Carmen
 
Posts: n/a

Default Re: Comp Sales in MDX - 11-24-2003 , 04:26 AM



Exactly what I was missing.

Thanks a lot.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.