dbTalk Databases Forums  

Not Corret result from LinkMember *** URGENT *** HELP ME ***

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


Discuss Not Corret result from LinkMember *** URGENT *** HELP ME *** in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
pezzulli@diesseci.it
 
Posts: n/a

Default Not Corret result from LinkMember *** URGENT *** HELP ME *** - 04-07-2006 , 02:19 AM






I have 2 organized dimensions :
[Mov].[ Year].[Month] and [EDZ].[ Year].[Month] where
Mov
stands for operation, movement and EDZ stands for Edition i.e. the
date creation of the product.
I have to find the total amount of products that have been "moved"
in a given period and how many of these have the date of creation=date
of movement.
I've tried to find it with LinkMember method:

QTA, [MOV].CurrentMember,LinkMemeber([MOV].CurrentMember,[EDZ])

The Result:

Quantity Quantity-EDZ [MOV] [EDZ]
10 2 [MOV].[ 2006] [EDZ].[2006]
3 0 [MOV].[2006].[January] [EDZ].[2001].[ January]

On level Year it gives me the correct result, but, on next level,
month, it seems to loose the year and gives me the same month, on
different year.

How can i try it by another way?

I apologize for my funny English, can someone help me?


Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Not Corret result from LinkMember *** URGENT *** HELP ME *** - 04-07-2006 , 11:52 AM






Looks like you're using AS 2000 - if so, the problem may be that the key
for the Month level isn't unique. For example, Jan 2005 may have the
same key as Jan 2006. You can either modify your time dimensions to make
the month key unique, or try a (slower) string function, like:

Quote:
QTA, [MOV].CurrentMember,
StrToMember("[EDZ].["
+ [MOV].CurrentMember.Name + "]")
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


Reply With Quote
  #3  
Old   
pezzulli@diesseci.it
 
Posts: n/a

Default Re: Not Corret result from LinkMember *** URGENT *** HELP ME *** - 04-10-2006 , 02:12 AM



Thanks, but this function give me an error, i try to create this query

with Member [Measures].[NEW] as '(
[Measures].[QUANTITA],[MOV].currentmember,StrToMember("[EDZ].["+[MOV].Currentmember.Name
+ "]"))'
Member [Measures].[EDZ_LINK] as
'StrToMember("[EDZ].["+[MOV].Currentmember.Name + "]")'
Member [Measures].[MOV_UNIQUE] as '[MOV].currentmember.UniqueName'
select {[Measures].[QUANTITA],
[Measures].[NEW],[Measures].[EDZ_LINK],[Measures].[MOV_UNIQUE]} on
columns, {[MOV].[Anno].members, [MOV].[Mese].members} on rows from
VENDITE


How i can modify the time dimension for make the month key unique?

Thanks again again
Giancarlo


Reply With Quote
  #4  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Not Corret result from LinkMember *** URGENT *** HELP ME *** - 04-10-2006 , 05:03 PM



Giancarlo,


To make the month key unique, you can concatenate the year and month
numbers, like "2006" + "04" = "200604"


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
  #5  
Old   
pezzulli@diesseci.it
 
Posts: n/a

Default Re: Not Corret result from LinkMember *** URGENT *** HELP ME *** - 04-11-2006 , 04:41 AM



Thanks again
on the dimension month i have set the Member key Column on
DatePart(year,"dbo"."DWMOV"."DAT-MOV")+DatePart(month,"dbo"."DWMOV"."DAT-MOV")
but when i reorganize the dimension give me an error if i set member
key unique on true else if i set on false on linkmember give me this
result:
[EDZ_LINK] [MOV_UNIQUE]
[EDZ].[TOTAL].[2005] [MOV].[TOTAL].[2005]
[EDZ].[TOTAL].[2006] [MOV].[TOTAL].[2006]
[EDZ].[TOTAL].[2007] [MOV].[TOTAL].[2006].[gennaio]
[EDZ].[TOTAL].[2008] [MOV].[TOTAL].[2006].[febbraio]


???
help me please


Reply With Quote
  #6  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Not Corret result from LinkMember *** URGENT *** HELP ME *** - 04-11-2006 , 10:16 AM



You need to cast each date part to a char data type, otherwise addition
will occur instead of concatenation:

Quote:
cast(DatePart(year,"dbo"."DWMOV"."DAT-MOV") as varchar)
+ cast(DatePart(month,"dbo"."DWMOV"."DAT-MOV") as varchar)
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


Reply With Quote
  #7  
Old   
pezzulli@diesseci.it
 
Posts: n/a

Default Re: Not Corret result from LinkMember *** URGENT *** HELP ME *** - 04-12-2006 , 01:55 AM



YOU ARE THE BIG

THANKS AGAIN
GOOD JOB
CIAO GIANCARLO


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.