dbTalk Databases Forums  

comparing properties of 2 different dimensions.

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


Discuss comparing properties of 2 different dimensions. in the microsoft.public.sqlserver.olap forum.



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

Default comparing properties of 2 different dimensions. - 07-03-2006 , 07:42 AM






Hi all,
I am using sql 2000 AS.
Working on a retailing cube where in all the distributors has a property
called "Coverage Day". This is the weekday when we get the data from the
distributor for his weekly sale. Now I want to show the no of coverage days
for a month.
If I am looking at data of 3rd July, which is monday, then all the
distributors who has coverage day as Monday shud show "Coverage Days" measure
as 1.
In case I am looking at july 06 (full month) the distributor shud show
"Coverage Days" measure as 5 (july 06 has 5 mondays).
I have added a property called "Week day" to my time dimension's Date level.

I tried to copmpare the properties of selected distributors and selected
time, but couldn't succeed.

IIF([Distributors].CurrentMember.Properties("Coverage Day") =
[Time].CurrentMember.Properties("Week Dy"),1,0)
I know this is the primary level MDX and I need to add lot of IIFs to it,
but for me even this basic qury is not working.

Can anyone suggest me the MDX/other solution for the above problem?

thanks.



Reply With Quote
  #2  
Old   
Francesco De Chirico
 
Posts: n/a

Default RE: comparing properties of 2 different dimensions. - 07-03-2006 , 09:21 AM






MDX has two IIF functions, one testing and returning integer and another
testing and returning string:

http://msdn.microsoft.com/library/de...intro_6n5f.asp

maybe the problem could be that you ask for returning a number but testing
two strings.
Try this

IIF([Distributors].CurrentMember.Properties("Coverage Day") =
[Time].CurrentMember.Properties("Week Dy"), "YES" ,"NO")


"k_s" wrote:

Quote:
Hi all,
I am using sql 2000 AS.
Working on a retailing cube where in all the distributors has a property
called "Coverage Day". This is the weekday when we get the data from the
distributor for his weekly sale. Now I want to show the no of coverage days
for a month.
If I am looking at data of 3rd July, which is monday, then all the
distributors who has coverage day as Monday shud show "Coverage Days" measure
as 1.
In case I am looking at july 06 (full month) the distributor shud show
"Coverage Days" measure as 5 (july 06 has 5 mondays).
I have added a property called "Week day" to my time dimension's Date level.

I tried to copmpare the properties of selected distributors and selected
time, but couldn't succeed.

IIF([Distributors].CurrentMember.Properties("Coverage Day") =
[Time].CurrentMember.Properties("Week Dy"),1,0)
I know this is the primary level MDX and I need to add lot of IIFs to it,
but for me even this basic qury is not working.

Can anyone suggest me the MDX/other solution for the above problem?

thanks.



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

Default RE: comparing properties of 2 different dimensions. - 07-05-2006 , 01:18 AM



Hi Francesco,
Thanks a lot. I need the sum of total days so I guess I have to make the
properties numeric (1 to 7 instead of monday etc).

thanks again.

"Francesco De Chirico" wrote:

Quote:
MDX has two IIF functions, one testing and returning integer and another
testing and returning string:

http://msdn.microsoft.com/library/de...intro_6n5f.asp

maybe the problem could be that you ask for returning a number but testing
two strings.
Try this

IIF([Distributors].CurrentMember.Properties("Coverage Day") =
[Time].CurrentMember.Properties("Week Dy"), "YES" ,"NO")


"k_s" wrote:

Hi all,
I am using sql 2000 AS.
Working on a retailing cube where in all the distributors has a property
called "Coverage Day". This is the weekday when we get the data from the
distributor for his weekly sale. Now I want to show the no of coverage days
for a month.
If I am looking at data of 3rd July, which is monday, then all the
distributors who has coverage day as Monday shud show "Coverage Days" measure
as 1.
In case I am looking at july 06 (full month) the distributor shud show
"Coverage Days" measure as 5 (july 06 has 5 mondays).
I have added a property called "Week day" to my time dimension's Date level.

I tried to copmpare the properties of selected distributors and selected
time, but couldn't succeed.

IIF([Distributors].CurrentMember.Properties("Coverage Day") =
[Time].CurrentMember.Properties("Week Dy"),1,0)
I know this is the primary level MDX and I need to add lot of IIFs to it,
but for me even this basic qury is not working.

Can anyone suggest me the MDX/other solution for the above problem?

thanks.



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.