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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Surppressing negative values

Status
Not open for further replies.

tsjd

Technical User
Apr 20, 2006
15
MY
I have a table and I wish to suppress certain fields where the amount is a negative one.

E.g.

Customer Name Total
------------- -----
zxczxczxczxcx 3
adb -4
llalal 5

How do I suppress the whole -4 field as I have to show the total sales? I'm running Crystal 8.5 Thanks in advance :)
 
If you want to suppress the entire row, then go to the section expert->details (assuming you are showing details in your example)->suppress->x+2 and enter:

{table.amt} < 0

If you then need to summarize the total column, you will need to use a conditional formula or a running total that excludes the amounts less than 0.

-LB
 
thanks, works now. How do I do that? Tried sum(table.amt) > 0 but it displays "true" as output
 
What you've got is a boolian. You can test it using its name. If it were called @negsum, you could say @negsum = true in the formula field. Or just say @negsum

You've also put > for <.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
If you want to use a conditional formula, then create a formula:

if {table.amt} > 0 then {table.amt}

Then insert a summary on this formula instead of on the field itself.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top