alternating row colours in Cognos 11 based on group

560 Views Asked by At

I have a simple list with 18 columns and several hundred rows of maintenance job data.

In Excel I can highlight potential duplicates by concatenating 5 of the columns (specifically excluding the job number) and comparing the results. If I sort by this concatenated column then the potential duplicate jobs sit one after another.

I can then add a calculation which is essentially 'if this cell equals the cell above then keep the count the same; if it is different then increment the count'. This results in the following:

Concat Count Job No. Room No. Location Problem
101BathroomToilet Leaking 1 69780814 101 Bathroom Toilet Leaking
101BathroomToilet Leaking 1 76041238 101 Bathroom Toilet Leaking
105BedroomCurtain Rail Missing 2 71493529 105 Bedroom Curtain Rail Missing
105BedroomCurtain Rail Missing 2 72043090 105 Bedroom Curtain Rail Missing

Finally; I can use the resulting 'Count' column to alternate the background colour for each set of potential duplicate jobs (using ISEVEN() & ISODD()).

I'm trying to recreate the report in Cognos and I have got stuck on the count column.

I can get a running-count of ALL of the rows (e.g. 1,2,3,4 for the above example) and, by using grouping, I can get a count of the number of each duplicate concat (e.g. 1,2,1,2 for the above example) but I cannot for the life of me work out how to get the count to run like the table above.

Any ideas?

Thanks in advance, Alan

1

There are 1 best solutions below

0
On

I managed to answer my own question in the end through copious amounts of trial and error.

If anyone is having the same problem then all you have to do is to wrap the initial count() into a running-count(). For example:

running-count( count([Concat] for [Room No.], [Location], [Problem Type]))

This will produce the count as per my original question.

Alan