COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: xyz on 02 Sep 2014 10:36:17 AM

Title: How to show parent member as a first row always along with its children
Post by: xyz on 02 Sep 2014 10:36:17 AM
Hi All,

I have a requirement, where I have Product Hierarchy tree prompt, whatever member is selected in Product Hierarchy tree prompt, list report displays selected member along with two measures Task and Workgroup considering it as a parent member along with its children. I want the selected member as a first row in the list report. Whereas the selected member displays in the list report as the last row.

Say Suppose 'A' is selected in the Product Hierarchy tree prompt.

Product Hierarchy structure:
Z
   B
      C
      D
   X
Say Suppose 'A' is selected in the Product Hierarchy tree prompt, then list reports display as below.

Current Output:

List Report displays like below.

Department       Task            Workgroup
B                        3                 5
X                        2                 6
Z                        5                11   

Expected Output:

Department       Task            Workgroup
Z                        5                11   
B                        3                 5
X                        2                 6

Can some one please help me on this, your help is much appreciated.

Thanks & Regards,
XYZ
Title: Re: How to show parent member as a first row always along with its children
Post by: MFGF on 02 Sep 2014 12:49:21 PM
How about an expression in a query calculation:

union([your hierarchy] -> ?Your Parameter?, children([your hierarchy] -> ?Your Parameter?))

Would this work?

MF.
Title: Re: How to show parent member as a first row always along with its children
Post by: xyz on 03 Sep 2014 02:22:07 AM
Hi MF,

Thanks for the prompt reply and for your solution. I appreciate you and all the guys in this forum, who always try to help others. In fact I applied the solution, before I saw your solution. It worked for me.

Earlier I was using the below expression:
union(children([your hierarchy] -> ?Your Parameter?), [your hierarchy] -> ?Your Parameter?)

Current expression:
union([your hierarchy] -> ?Your Parameter?, children([your hierarchy] -> ?Your Parameter?))


Thanks & Regards,
XYZ