COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: adam_mc on 10 Jul 2020 01:40:08 PM

Title: Tree Prompt Default Selections for Report using a Transformer Cube
Post by: adam_mc on 10 Jul 2020 01:40:08 PM
I have a Date Hierarchy from a Transformer Cube that provides date members Year, Quarter, Month, and Week for the last 3 years (in this case 2018, 2019, 2020).
I want to set the default selection for a Tree Prompt to the current year (2020) and then allow the business user to select any level as they see fit.

I can set the default selection to the value [Cube Name].[Date Hierarchy].[Date Hierarchy].[Year]->:[PC].[@MEMBER].[2020] and this works for now.
However, when we role into 2021 this will not be the most current year, and eventually, this will not work at all when [2020] is not a valid member.

How can I set the default selection to in effect be the last child in the Year level?

Any help will be gratefully appreciated.
Thanks in advance,
Adam.
Title: Re: Tree Prompt Default Selections for Report using a Transformer Cube
Post by: MFGF on 10 Jul 2020 01:48:54 PM
Quote from: adam_mc on 10 Jul 2020 01:40:08 PM
I have a Date Hierarchy from a Transformer Cube that provides date members Year, Quarter, Month, and Week for the last 3 years (in this case 2018, 2019, 2020).
I want to set the default selection for a Tree Prompt to the current year (2020) and then allow the business user to select any level as they see fit.

I can set the default selection to the value [Cube Name].[Date Hierarchy].[Date Hierarchy].[Year]->:[PC].[@MEMBER].[2020] and this works for now.
However, when we role into 2021 this will not be the most current year, and eventually, this will not work at all when [2020] is not a valid member.

How can I set the default selection to in effect be the last child in the Year level?

Any help will be gratefully appreciated.
Thanks in advance,
Adam.

Hi,

You could perhaps look at using a macro for this?

#'[Cube Name].[Date Hierarchy].[Date Hierarchy].[Year]->:[PC].[@MEMBER].[' + timestampMask ($current_timestamp, 'YYYY') + ']'#

Would that work for you?

Cheers!

MF.
Title: Re: Tree Prompt Default Selections for Report using a Transformer Cube
Post by: adam_mc on 10 Jul 2020 02:05:31 PM
Thanks MFGF...

However, it seems that I am only able to select "Packaged Items" as default selections.
Only the members in the levels Year, Quarter, Month, are able to be selected.

For example:
2020
   2020 Q1
      2020 Jan
           1/1/2020
           1/15/2020
      2020 Feb
etc..

It doesn't appear that there isn't any way to edit the default values (we are using CA 11.0.13).
I was thinking that I'm either going to have to force a prompt screen without defaults or change the values of the Year members to be TY, LY, and 2Y or something else that is consistent - But, I just don't like the way this is presented to the business.
Is there a Java Script solution that might work?

Thanks again,
Adam.