COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: Hidayathulla on 08 Aug 2023 10:40:06 PM

Title: Cognos Report Studio - Hide a filed based on data present in other filed.
Post by: Hidayathulla on 08 Aug 2023 10:40:06 PM
my  report contains Role & SubRole (Parent-child table relationship) showing one below the other.
I want to  suppressing the SubRole when it's matching exactly with Parent Role.
Expectation : when role description matches with the Sub role then the respective subrole row should not be shown.
I have tried different ways , but no luck as of now. please help me to achieve this.
(https://ibb.co/C0rH52h)



Title: Re: Cognos Report Studio - Hide a filed based on data present in other filed.
Post by: cognostechie on 09 Aug 2023 01:26:48 PM
Maybe use a hand written SQL to do this. I don't know the name of the tables/fields but you can find that out and replace them in this SQL



SELECT
  R1.ROLE_ID,
  R1.ROLE_DESCRIPTION,
  S1.SUBROLE_DESCRIPTION
FROM
(
SELECT
   ROLE_ID,
   ROLE_DESCRIPTION,
FROM ROLE_TABLE
) R1
LEFT OUTER JOIN
(
SELECT
   R.ROLE_ID
   R.ROLE_DESCRIPTION,
   S.SUBROLE_DESCRIPTION
FROM ROLE_TABLE R
INNER JOIN SUBROLE_TABLE S ON R.ROLE_ID = S.ROLE_ID
WHERE R.ROLE_DESCRIPTION <> S.SUBROLE_DESCRIPTION
) S1
ON R1.ROLE_ID = S1.ROLE_ID
 
Title: Re: Cognos Report Studio - Hide a filed based on data present in other filed.
Post by: MFGF on 09 Aug 2023 03:09:42 PM
Quote from: Hidayathulla on 08 Aug 2023 10:40:06 PM
my  report contains Role & SubRole (Parent-child table relationship) showing one below the other.
I want to  suppressing the SubRole when it's matching exactly with Parent Role.
Expectation : when role description matches with the Sub role then the respective subrole row should not be shown.
I have tried different ways , but no luck as of now. please help me to achieve this.
(https://ibb.co/C0rH52h)

I would use a conditional block for this. Include the SubRole in the block, and have the block hidden when the Role matches the SubRole.

Cheers!

MF.
Title: Re: Cognos Report Studio - Hide a filed based on data present in other filed.
Post by: cognostechie on 09 Aug 2023 03:48:41 PM
I think his requirement is to hide the subrole but display the role.
Title: Re: Cognos Report Studio - Hide a filed based on data present in other filed.
Post by: dougp on 09 Aug 2023 04:09:38 PM
I question the vocabulary or implementation.  It is not possible for me to be my own child.