Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One List affects the results of a second list - WHY?

Status
Not open for further replies.

RyanDonohue

Technical User
Jun 10, 2011
18
US
I have a list in my report that uses a custom grouping based on the name of the object. For example,

Case when [Name] in ('Cat','Dog') then ('Mammal')
When [Name] in ('Lizard') then ('Reptile')
...etc...
End

In some circumstances, the grouped items will repeat themselves based on level below it. Continuing with the above example, the result would look like:

Type Count
Mammal 1
Mammal 2
Reptile 1
Total 4

This should have displayed:
Type Count
Mammal 3
Reptile 1
Total 4

I have found that this is often an issue with some change I did in my list and grouping, so I rebuilt the list from scratch and put it before the list that was not working so I could tie out numbers. Please note I am using the same query.

This new list did the same thing and repeated the records. The old list, however, now showed everything as expected. I thought this was a fluke and removed the new list. The old list reverted to its previous behavior.

The first list each time will show incorrectly, but the second and identical list will show the proper result. The only change is the inclusion of a first list.

Can anyone explain why having a list in a report will change the behavior of an additional list even though they are pointed to the same query?

Thanks
 
I would expect that Cognos somehow makes a split based on [name].
Try to define the case around the actual model query item like:

CASE
WHEN [SOMENAMESPACE].[Name]
('Cat','Dog') then ('Mammal')
When [SOMENAMESPACE].[Name] in ('Lizard') then ('Reptile')
...etc...
End

instead of using [Name] as dataitem in the report.

Ties Blom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top