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!

Zeros need to be taken out only if all columns are zero

Status
Not open for further replies.

piratedog

Programmer
Aug 1, 2002
10
0
0
US
I have a report that is working fine but the only thing is that it is showing customers with a zero balance. I do not want to show any customers which have zero in all columns. If they have anything in just one column that is not zero I want that customer to show. Any suggestions??
Here are my fields
cust# name due 15pastdue 30pastdue 45pastdue
100 abc 0 15 0 0
101 def 0 0 0 0
102 ghi 20 0 100 0

Thanks for all your help in advance [puppy]
 
Create sums for the columns and use the Suppress for the detail based on the sum = 0:

Sum ({MyTable.due), {@MyCustomerGrouping})
// the second part of the sum is the group
+
Sum ({MyTable.15pastdue), {@MyCustomerGrouping})
+
...etc.
= 0
// the second part of the sum is the group

or without a group:

Sum ({p_trust_rpt_change_assets.gain_loss}) = 0
...

-k kai@informeddatadecisions.com
 
I assume this is a group subtotal. If so create a formula field {@TotalOwed} whioch would be due=15PastDue + 30PastDue + 45PastDue. Sum this formula at teh customer level as well. You can suppress both the formula and the sum if you do not wish to see them.

then to get rid of custopmers with a zero balance, write a group selection formula:

Sum({@TotalOwed},{Customer})<>0 Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
Thank you for your help, but I am lost, I have no group subtotal. I have only sum each column thats it. I am still new at this crystal reports. [puppy]
 
Do you have a formula or a database field that represents the total amount owed? If not create it and place it in oyur details section. Then right it and select insert summary, and you want to summarize by Customer.

The in your group selection formula put the following (this assumes you must wwrite a formula for total owed, if not then replace the {@TotalOwed} with your database field):

Sum({@TotalOwed},{Customer})<>0

To get to the group selection formula click on report, edit selection formula, group.

Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
Thanks everyone for your help. I got my report working thanks to great help!!
[puppy]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top