Ancestor function Versus More than 1 parent
Posted: Fri Oct 19, 2012 11:35 pm
Hi everyone,
I'm a newbie working with Report Studio (Cognos 10.1.1) reading from a TM1 data source. I'm dealing with a Time dimension which has hierarchies like this:
- 2012-01-01_YTD
|-- 2012-01-01
- 2012-01-02_YTD
|-- 2012-01-01
|-- 2012-01-02
[...]
- Total 2012 per week
|-- 2012_week_0
|-- 2012-01-01
|-- 2012-01-02
[...]
The report has a Date Prompt. I have to select the 'total week' of that date chosen by the user. So I created a data item with an expression to return this element. I have tried these expressions (I have hardcoded the dates for testing purposes):
parent([Daily Sales].[Period Days].[Period Days]->:[TM].[Period Days].[Period Days].[@MEMBER].[2012-01-01])
ancestors([Daily Sales].[Period Days].[Period Days]->:[TM].[Period Days].[Period Days].[@MEMBER].[2012-01-01], 1)
Both return the element [2012-01-01_YTD].
How can I control which parent will be returned?
Thank you!
I'm a newbie working with Report Studio (Cognos 10.1.1) reading from a TM1 data source. I'm dealing with a Time dimension which has hierarchies like this:
- 2012-01-01_YTD
|-- 2012-01-01
- 2012-01-02_YTD
|-- 2012-01-01
|-- 2012-01-02
[...]
- Total 2012 per week
|-- 2012_week_0
|-- 2012-01-01
|-- 2012-01-02
[...]
The report has a Date Prompt. I have to select the 'total week' of that date chosen by the user. So I created a data item with an expression to return this element. I have tried these expressions (I have hardcoded the dates for testing purposes):
parent([Daily Sales].[Period Days].[Period Days]->:[TM].[Period Days].[Period Days].[@MEMBER].[2012-01-01])
ancestors([Daily Sales].[Period Days].[Period Days]->:[TM].[Period Days].[Period Days].[@MEMBER].[2012-01-01], 1)
Both return the element [2012-01-01_YTD].
How can I control which parent will be returned?
Thank you!