COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Topic started by: CoginAustin on 13 Dec 2005 08:15:12 AM

Title: [Solved] Removing lines from list
Post by: CoginAustin on 13 Dec 2005 08:15:12 AM
What is the best way to remove lines from a list report that equal the sub-total.

Example:

Group A
Ã,  Value = 10
Ã,  Value = 20
Sub-total = 30
Group B
Ã,  Value = 50
Sub-total = 50

I would like to remove the Value = 50 but keep the sub-total=50 since it is the only item in the group and the same value as the subtotal.

Thanks in advance

Title: Re: Removing lines from list
Post by: sir_jeroen on 13 Dec 2005 08:48:50 AM
Remove all line and add a border around Subtotal...
Title: Re: Removing lines from list
Post by: CoginAustin on 13 Dec 2005 08:55:26 AM
I dont get it. I need to remove the entire row. There may be 3 other columns. I just used the above as a simple example.

The data may be:
Group B
Value1 = 10 Value2=30 Total=40
GroupB Sub-total1=10 Subtotal2=30 Total=40

So if the totals of each group match a single line for that group I need to hide that line
Title: Re: Removing lines from list
Post by: bdybldr on 13 Dec 2005 12:33:52 PM
Austin, Try this....

Add a data item (RowCount) to the query (not the report) that looks like this:

IF (Count(([GroupName]) for [GroupName] = 1))
THEN (1)
ELSE (0)

Next, create a variable of type Boolean.Ã,  Set the expression as: RowCount(data item created earlier) = 1.

Then, go to the report page and select the list column in your report.Ã,  Go to Conditional style property under General and click the dropdown to select the variable we created earlier.

Then, go to the condition explorer and select "Yes" under the variable that you created.Ã,  The explorer bar will turn green.Ã,  select the list column (one at a time) and set the box type to "None".

This will hide the value records when there is only one row of data.

You could also do this for value = Sub-Total for GroupName.Ã,  Ã, Hope this helps.
Title: Re: Removing lines from list
Post by: sir_jeroen on 13 Dec 2005 01:16:30 PM
Have you tried:
2 columns:
    col1            col2
[Group xx] [Calculation]

Calculation: "Total (Value FOR [Group A])"

This will result in:
  col1                col2
Group A           30
Group B           50

(Based on your original data)
Title: Re: Removing lines from list
Post by: sir_jeroen on 13 Dec 2005 01:17:07 PM
Btw: The thing is that you only want to show the totals and not the details? Am I correct?
Title: Re: Removing lines from list
Post by: bdybldr on 13 Dec 2005 01:32:31 PM
RNA,
If I understand correctly, he wants to show the details if there is more than one record.  If there is only one, then he only wants the subtotal to be displayed.

Is that right Austin?
Title: Re: Removing lines from list
Post by: sir_jeroen on 13 Dec 2005 01:36:19 PM
ohhhh... than it's simple.. conditional formatting using a running-count for group... if running-count = 1 then hide...


that's all.... (btw... almost the same as bdybuilder so all honors go to him)


(I hope ;) )
Title: Re: Removing lines from list
Post by: bdybldr on 13 Dec 2005 01:51:55 PM
Thanks, RNA.  That's an honor coming from you.

Running-total for group is much easier.  Good call.
Title: Re: Removing lines from list
Post by: sir_jeroen on 13 Dec 2005 02:47:33 PM
No.. Running-count :D
Title: Re: Removing lines from list
Post by: bdybldr on 13 Dec 2005 02:59:28 PM
oops..my bad!   :-[
Title: Re: Removing lines from list
Post by: CoginAustin on 13 Dec 2005 03:25:48 PM
Thanks everyone. I got it.
Title: Re: Removing lines from list
Post by: sir_jeroen on 14 Dec 2005 02:01:49 AM
Please close the topic...
Good Luck
Title: Re: Removing lines from list
Post by: Cajou on 07 Jan 2013 06:56:27 AM
Hello everybody, I'm new here and relatively new to Cognos as well.
I had the same question and I was very glad to have found the answer here, but I don't know how to perform a conditional format using a running-count per group  :-[

Would anybody here be so kind to explain how to do this and give me a more step-by-step guide ?  :)

THX in advance !