COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: gosoccer on 25 Oct 2012 07:38:06 AM

Title: SECTION in Report Author based on specific Condition or Column
Post by: gosoccer on 25 Oct 2012 07:38:06 AM
THis problem is related to Report Author using NON-CUBE Package based Datasource.

SECTION based on certain field or condition.

The following is occured incorrectly,

ORG_ID: A (SECTION)
UNIQUE ID            TYPE                     ORG_ID
2121322                  1                          A
2121322                  1                          A

ORG_ID:NULL
2121322                  2                          NULL

I need the following to occur,
ORG_ID: A (SECTION)
2121322                  1                          A
2121322                  1                          A
2121322                  2                          NULL

Since all 2121322 people are related so I need them under the same ORG_ID.
The report Author is breaking them to a different section since TYPE 2 doesn't have ORG_ID (NULL)

Thx so much!
Title: Re: SECTION in Report Author based on specific Condition or Column
Post by: Rahul Ganguli on 25 Oct 2012 11:46:41 AM
Hi,

You can create another dataitem which will contain a conditional statement so whenever you get a null it will replace it with ORG_ID.
Use the new dataitem to section the report.

Regards,
Rahul
Title: Re: SECTION in Report Author based on specific Condition or Column
Post by: gosoccer on 25 Oct 2012 12:15:20 PM
Rahul,
How would I get the ORG_ID that matches to A or the main parent's ORG_ID?
Thx,
Title: Re: SECTION in Report Author based on specific Condition or Column
Post by: Rahul Ganguli on 25 Oct 2012 12:22:02 PM
Hi,

This could be achieved either of two ways
1. Use two queries and join them, this way you will have liberty to do some calculations
2. Use max(ORG_ID for Unique_ID) to replace ORG_ID wherever it is null

Hope this helps.

Regards,
Rahul
Title: Re: SECTION in Report Author based on specific Condition or Column
Post by: gosoccer on 25 Oct 2012 03:23:49 PM
So Rahul,
Just to clarify,
This could be achieved either of two ways
1. Use two queries and join them, this way you will have liberty to do some calculations
Two queries and join them before creating the List. What would be the join based on?

2. Use max(ORG_ID for Unique_ID) to replace ORG_ID wherever it is null
The SECTION is focing the grouping of Unique values as Section Group unless if I am not taking the rght stpes.
Could you please clarify?

I guess a little more detail would really help since I am not as experienced as I should be?

Thx,
Title: Re: SECTION in Report Author based on specific Condition or Column
Post by: gosoccer on 26 Oct 2012 10:04:23 AM
None of the suggestions worked.

I established two Queries within Report Author. Used one for SECTION and the other to list the data.
The report is still putting the records without an ORG_ID into it's own SECTION Grouping.

I tried the maximum  as below but didn't assign the parent's ORG_ID (TYPE 1) to the Child ORG_ID (TYPE2) so they can stay in the same listing. If there was a way to do this, I think it'll do the trick. I Right Click on the Data Item, Calculate, Custom, and added the following. It created a separate Data Item as a Coumn in the report. Then I added the Expression below thinking that it will take the TYPE 1's ORG_ID and assign it to any records associated to the specific Query being executed, but no luck.

Quotecase when [BUSINESS_VIEW].[QUERY].[TYPE] <> '1'
then ( maximum([BUSINESS_VIEW].[QUERY].[ORG_ID]))
end

Do I need to get rid of SECTIONING. I can't believe there isn't a way to SECTION based on certain condition? If I tell it to SECTION only when the column is not NULL, it'll do the job but entirely wipes the records from the report with the NULL Org_ID.

If anyone has a sample document or process to take, I would greatly appreciate it.

HELP!!