dbTalk Databases Forums  

ParallelPeriod and Cousin functions don't work with Parent-Child dimensions...

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


Discuss ParallelPeriod and Cousin functions don't work with Parent-Child dimensions... in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
jccjccjccjcc@hotmail.com
 
Posts: n/a

Default ParallelPeriod and Cousin functions don't work with Parent-Child dimensions... - 12-30-2004 , 11:12 AM






Hello,

It seems that both "ParallelPeriod" and "Cousin" functions don't work
with a Parent Child dimension; all functions querying members of the
same family tree or level seem to be working fine ( Ancestors,
Descendants, lag, FirstSibling, ... ).

Does anyone has any advice on this (beside writing an MDX syntax that
would return the same result "ParallelPeriod") ?

Thank you,

JC


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

Default Re: ParallelPeriod and Cousin functions don't work with Parent-Child dimensions... - 12-30-2004 , 06:17 PM






Can you explain what the P-C dimension looks like, and how you are using
ParallelPeriod()? Keep in mind that there is only a single level defined
for such a dimension:

http://msdn.microsoft.com/library/de.../en-us/olapdma
d/agdimensions_5ab7.asp
Quote:
...
Unlike regular and virtual dimensions, which are defined with a number
of levels that determines the number of levels seen by end users, a
parent-child dimension is defined with a single level of a special type
that usually produces multiple levels seen by end users. The number of
displayed levels depends on the contents of the columns that store the
member keys and the parent keys. This number can change when the
dimension table is updated and the cubes using the dimension are
subsequently processed.
...
Quote:

- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Reply With Quote
  #3  
Old   
jccjccjccjcc@hotmail.com
 
Posts: n/a

Default Re: ParallelPeriod and Cousin functions don't work with Parent-Child dimensions... - 12-31-2004 , 03:53 AM



thank you for your answer....

Here Is the MDX query I use :
-----------------------------------------
WITH
MEMBER [Measures].[TEST] as
'parallelPeriod( [Time].[Année], 1, [Time].CurrentMember).UniqueName'


SELECT
{ [Measures].[Effectif], [Measures].[TEST] } ON 0,
{ Descendants( [Time].&[A2000], [Time].[Période] ), DESCENDANTS(
[Time].&[A2001], [Time].[Période] ) } ON 1
FROM [FastFood_TEST1]




Dimension properties (non default only) :
-----------------------------------
Member Key Column = "dbo"."V8fastfood_TIME"."TIME"
Parent Key Column = "dbo"."V8fastfood_TIME"."PARENT"
Member Name Column = "dbo"."V8fastfood_TIME"."LABEL"
All level = No
Members with data = Non-leaf data hidden


Level properties :
----------------------
Level Naming Template : Année;Semestre;Trimestre;Période
(these are the Levels seen FROM the client)
Member count : 53


V8fastfood content :
---------------------------
TIME LABEL PARENT
P200001 2000.Periode.01 T20001
P200002 2000.Periode.02 T20001
P200003 2000.Periode.03 T20001
T20001 2000.Trimestre.1 S20001
P200004 2000.Periode.04 T20002
P200005 2000.Periode.05 T20002
P200006 2000.Periode.06 T20002
T20002 2000.Trimestre.2 S20001
S20001 2000.Semestre.1 A2000
P200007 2000.Periode.07 T20003
P200008 2000.Periode.08 T20003
P200009 2000.Periode.09 T20003
T20003 2000.Trimestre.3 S20002
P200010 2000.Periode.10 T20004
P200011 2000.Periode.11 T20004
P200012 2000.Periode.12 T20004
P200013 2000.Periode.13 T20004
T20004 2000.Trimestre.4 S20002
S20002 2000.Semestre.2 A2000
A2000 2000.Annee.
P200101 2001.Periode.01 T20011
P200102 2001.Periode.02 T20011
P200103 2001.Periode.03 T20011
T20011 2001.Trimestre.1 S20011
P200104 2001.Periode.04 T20012
P200105 2001.Periode.05 T20012
P200106 2001.Periode.06 T20012
T20012 2001.Trimestre.2 S20011
S20011 2001.Semestre.1 A2001
P200107 2001.Periode.07 T20013
P200108 2001.Periode.08 T20013
P200109 2001.Periode.09 T20013
T20013 2001.Trimestre.3 S20012
P200110 2001.Periode.10 T20014
P200111 2001.Periode.11 T20014
P200112 2001.Periode.12 T20014
P200113 2001.Periode.13 T20014
T20014 2001.Trimestre.4 S20012
S20012 2001.Semestre.2 A2001
A2001 2001.Annee.
P200201 2002.Periode.01 T20021
P200202 2002.Periode.02 T20021
P200203 2002.Periode.03 T20021
T20021 2002.Trimestre.1 S20021
P200204 2002.Periode.04 T20022
P200205 2002.Periode.05 T20022
P200206 2002.Periode.06 T20022
T20022 2002.Trimestre.2 S20021
S20021 2002.Semestre.1 A2002
P200207 2002.Periode.07 T20023
P200208 2002.Periode.08 T20023
P200209 2002.Periode.09 T20023
T20023 2002.Trimestre.3 S20022
P200210 2002.Periode.10 T20024
P200211 2002.Periode.11 T20024
P200212 2002.Periode.12 T20024
P200213 2002.Periode.13 T20024
T20024 2002.Trimestre.4 S20022
S20022 2002.Semestre.2 A2002
A2002 2002.Annee.
P200301 2003.Periode.01 T20031
P200302 2003.Periode.02 T20031
P200303 2003.Periode.03 T20031
T20031 2003.Trimestre.1 S20031
P200304 2003.Periode.04 T20032
P200305 2003.Periode.05 T20032
P200306 2003.Periode.06 T20032
T20032 2003.Trimestre.2 S20031
S20031 2003.Semestre.1 A2003
P200307 2003.Periode.07 T20033
P200308 2003.Periode.08 T20033
P200309 2003.Periode.09 T20033
P200310 2003.Periode.10 T20033
T20033 2003.Trimestre.3 S20032
P200311 2003.Periode.11 T20034
P200312 2003.Periode.12 T20034
P200313 2003.Periode.13 T20034
T20034 2003.Trimestre.4 S20032
S20032 2003.Semestre.2 A2003
A2003 2003.Annee.


Reply With Quote
  #4  
Old   
Chris Webb
 
Posts: n/a

Default Re: ParallelPeriod and Cousin functions don't work with Parent-Chi - 12-31-2004 , 04:07 AM



This isn't relevant here though (you only really need to consider the fact
there is only one level when you are thinking about aggregation design) and
MDX functions like ParallelPeriod still work correctly based on the displayed
hierarchy as far as I can see. For example, from Foodmart 2000 look at the
following query:

with member measures.test as 'parallelperiod([Account].[Level 03], 1,
[Account].currentmember).name'
select {measures.test} on 0,
[Account].[Level 04].members on 1
from budget

It does exactly what I'd expect. Possibly the confusion is arising from the
structure of the p/c dimension, or from not specifying all the arguments the
functions need?

Chris


"Deepak Puri" wrote:

Quote:
Can you explain what the P-C dimension looks like, and how you are using
ParallelPeriod()? Keep in mind that there is only a single level defined
for such a dimension:

http://msdn.microsoft.com/library/de.../en-us/olapdma
d/agdimensions_5ab7.asp

...
Unlike regular and virtual dimensions, which are defined with a number
of levels that determines the number of levels seen by end users, a
parent-child dimension is defined with a single level of a special type
that usually produces multiple levels seen by end users. The number of
displayed levels depends on the contents of the columns that store the
member keys and the parent keys. This number can change when the
dimension table is updated and the cubes using the dimension are
subsequently processed.
...



- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Reply With Quote
  #5  
Old   
jccjccjccjcc@hotmail.com
 
Posts: n/a

Default Re: ParallelPeriod and Cousin functions don't work with Parent-Chi - 12-31-2004 , 09:34 AM



Chris,

thank you for your help. I tested this using MS AS MDX Sample
Application and it does work (ealier tests were done using a specific
client application).

I then tested this changing the value of "Mdx Compatibility" to 2 in
the connection string and got an error message ! => "The function
doesn't support ragged hierarchies".

However, I'm wandering whether setting the value ot this property to 1
while connecting to MS AS 2000 might have any side effect ?

JC


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

Default Re: ParallelPeriod and Cousin functions don't work with Parent-Chi - 12-31-2004 , 06:07 PM



You're right in general, Chris - though there seem to be some cases that
I can't quite explain. Consider this Foodmart HR cube query on the
Employees dimension:

Quote:
With Member Measures.PrevEmpl as
'ParallelPeriod([Employees].[Senior Management],
1, [Employees].CurrentMember).Name'

Select {Measures.PrevEmpl} on 0,
[Employees].[Level].Members on 1
From HR
Quote:
ParallelPeriod() returns members of the [Senior Management] level in 3
cases where it should return null:

Employee | PrevEmpl
------------------------------------
Jessica Olguin | Rebecca Kanagaki
Jonathan Murraiin | Robert Damstra
Concepcion Lozada | Donna Arnold


- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Reply With Quote
  #7  
Old   
Chris Webb
 
Posts: n/a

Default Re: ParallelPeriod and Cousin functions don't work with Parent-Chi - 01-04-2005 , 05:05 AM



OK, I think I can see what's going on here. The Employees dimension has
'members with data' which means that there are hidden datamembers with the
same name as the parent at the end of each level, containing the data for the
parent. They are not visible, but they have to be accessible to the user and
therefore show up on the hierarchy functions - which means that
Parallelperiod gets a bit confused. Here's your query slightly modified:

With Member Measures.PrevEmpl as 'ParallelPeriod([Employees].[Senior
Management], 1, [Employees].CurrentMember).Name'
member measures.datamembercheck as 'ParallelPeriod([Employees].[Senior
Management], 1, [Employees].CurrentMember) is
employees.currentmember.parent.prevmember.datamemb er'
Select {Measures.PrevEmpl,measures.datamembercheck} on 0,
[Employees].[Level].Members on 1 From HR

Chris

"Deepak Puri" wrote:

Quote:
You're right in general, Chris - though there seem to be some cases that
I can't quite explain. Consider this Foodmart HR cube query on the
Employees dimension:


With Member Measures.PrevEmpl as
'ParallelPeriod([Employees].[Senior Management],
1, [Employees].CurrentMember).Name'

Select {Measures.PrevEmpl} on 0,
[Employees].[Level].Members on 1
From HR


ParallelPeriod() returns members of the [Senior Management] level in 3
cases where it should return null:

Employee | PrevEmpl
------------------------------------
Jessica Olguin | Rebecca Kanagaki
Jonathan Murraiin | Robert Damstra
Concepcion Lozada | Donna Arnold


- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Reply With Quote
  #8  
Old   
Chris Webb
 
Posts: n/a

Default Re: ParallelPeriod and Cousin functions don't work with Parent-Chi - 01-04-2005 , 05:13 AM



Well, do you need to see ragged hierarchies on your time dimension? A quick
look at the contents of your time dimension suggests you don't, so leaving
MDX Compatibility at 1 shouldn't cause you any problems I think.

Chris

"jccjccjccjcc (AT) hotmail (DOT) com" wrote:

Quote:
Chris,

thank you for your help. I tested this using MS AS MDX Sample
Application and it does work (ealier tests were done using a specific
client application).

I then tested this changing the value of "Mdx Compatibility" to 2 in
the connection string and got an error message ! => "The function
doesn't support ragged hierarchies".

However, I'm wandering whether setting the value ot this property to 1
while connecting to MS AS 2000 might have any side effect ?

JC



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

Default Re: ParallelPeriod and Cousin functions don't work with Parent-Chi - 01-04-2005 , 10:15 AM



Thanks Chris - that explains why these data members were returned by
ParallelPeriod() - but this behavior doesn't seem consistent with them
being "hidden". They are not returned by ().Children or in the
().Members list of the lower level. So which MDX functions should they
be visible to by design - or is that undefined?


- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #10  
Old   
Chris Webb
 
Posts: n/a

Default Re: ParallelPeriod and Cousin functions don't work with Parent-Chi - 01-04-2005 , 10:45 AM



I guess it's undefined - or possibly a bug, since it's inconsistent. When the
dev team changed the .Children and .Members functions (as well as various
others) so that they ignored datamembers, perhaps ParallelPeriod and Cousin
were forgotten about. Maybe someone from MS can comment? I would expect that
you would be able to return a datamember using the .Datamember function, as
in:

SELECT {[Employees].[All Employees].[Sheri Nowmer].[Rebecca Kanagaki],
[Employees].[All Employees].[Sheri Nowmer].[Rebecca Kanagaki].datamember} ON
0 FROM HR

....but in no other way.

Chris

"Deepak Puri" wrote:

Quote:
Thanks Chris - that explains why these data members were returned by
ParallelPeriod() - but this behavior doesn't seem consistent with them
being "hidden". They are not returned by ().Children or in the
().Members list of the lower level. So which MDX functions should they
be visible to by design - or is that undefined?


- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


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.