COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: et21 on 26 Apr 2023 10:07:54 PM

Title: Parent Child relationship
Post by: et21 on 26 Apr 2023 10:07:54 PM
Hi all,

I have a parent child projects like below

Project 1
==> Project 1.1
       ===> Project 1.1.1

I want to display all of that projects that under Project 1. is there a way to do that?

TIA
Title: Re: Parent Child relationship
Post by: dougp on 27 Apr 2023 11:40:36 AM
Maybe provide query subject and query item names so there is less translation from my guesses to your actual solution.

One level deep?  That's easy.  Role play your Project query subject as ChildProject.

Queries:
Project
ChildProject - copy of Project
output - join Project and ChildProject on Project.ProjectNum = ChildProject.ParentProjectNum

All levels?
The query will need to use SQL written as a recursive CTE - probably using the pass-thru option.


Create visualizations as needed.