Author Topic: [Solved] Removing lines from list  (Read 13387 times)

Offline CoginAustin

  • Community Leader
  • *****
  • Join Date: Jul 2005
  • Posts: 189
  • Forum Citizenship: +10/-0
[Solved] Removing lines from list
« 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

« Last Edit: 14 Dec 2005 06:59:29 pm by CoginAustin »

Offline ReportNet Addict

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Sep 2005
  • Posts: 957
  • Forum Citizenship: +65/-41
  • Creator of the Impact Suite
    • The Impact Suite
Re: Removing lines from list
« Reply #1 on: 13 Dec 2005 08:48:50 am »
Remove all line and add a border around Subtotal...

Offline CoginAustin

  • Community Leader
  • *****
  • Join Date: Jul 2005
  • Posts: 189
  • Forum Citizenship: +10/-0
Re: Removing lines from list
« Reply #2 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

Offline bdybldr

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Oct 2005
  • Posts: 275
  • Forum Citizenship: +9/-1
Re: Removing lines from list
« Reply #3 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.
« Last Edit: 13 Aug 2008 08:42:52 am by bdybldr »

Offline ReportNet Addict

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Sep 2005
  • Posts: 957
  • Forum Citizenship: +65/-41
  • Creator of the Impact Suite
    • The Impact Suite
Re: Removing lines from list
« Reply #4 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)

Offline ReportNet Addict

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Sep 2005
  • Posts: 957
  • Forum Citizenship: +65/-41
  • Creator of the Impact Suite
    • The Impact Suite
Re: Removing lines from list
« Reply #5 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?

Offline bdybldr

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Oct 2005
  • Posts: 275
  • Forum Citizenship: +9/-1
Re: Removing lines from list
« Reply #6 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?

Offline ReportNet Addict

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Sep 2005
  • Posts: 957
  • Forum Citizenship: +65/-41
  • Creator of the Impact Suite
    • The Impact Suite
Re: Removing lines from list
« Reply #7 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 ;) )
« Last Edit: 13 Dec 2005 01:38:06 pm by ReportNet Addict »

Offline bdybldr

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Oct 2005
  • Posts: 275
  • Forum Citizenship: +9/-1
Re: Removing lines from list
« Reply #8 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.

Offline ReportNet Addict

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Sep 2005
  • Posts: 957
  • Forum Citizenship: +65/-41
  • Creator of the Impact Suite
    • The Impact Suite
Re: Removing lines from list
« Reply #9 on: 13 Dec 2005 02:47:33 pm »
No.. Running-count :D

Offline bdybldr

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Oct 2005
  • Posts: 275
  • Forum Citizenship: +9/-1
Re: Removing lines from list
« Reply #10 on: 13 Dec 2005 02:59:28 pm »
oops..my bad!   :-[

Offline CoginAustin

  • Community Leader
  • *****
  • Join Date: Jul 2005
  • Posts: 189
  • Forum Citizenship: +10/-0
Re: Removing lines from list
« Reply #11 on: 13 Dec 2005 03:25:48 pm »
Thanks everyone. I got it.

Offline ReportNet Addict

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Sep 2005
  • Posts: 957
  • Forum Citizenship: +65/-41
  • Creator of the Impact Suite
    • The Impact Suite
Re: Removing lines from list
« Reply #12 on: 14 Dec 2005 02:01:49 am »
Please close the topic...
Good Luck

Offline Cajou

  • Associate
  • **
  • Join Date: Jan 2013
  • Posts: 1
  • Forum Citizenship: +0/-0
Re: Removing lines from list
« Reply #13 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 !

 


       
Twittear