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!

Sum visible only data

Status
Not open for further replies.

brecat77

IS-IT--Management
Feb 27, 2008
28
US
I am trying to sum a field, but i only want the sum of the visible selection. help please.
 
From the question, is it safe to assume that you are suppressing sections in your data using a formula? If that's the case, create a formula like this:

if <criteria to suppress section> then {Field to Sum} else 0

Now you can sum the formula instead of the field. NOTE: This only works if you're not using Previous() or Next() in the suppression criteria. If you are, there are other ways to get this info.

-Dell

DecisionFirst Technologies - Seven-time SAP BusinessObjects Solution Partner of the Year
 
This is what i was suppressing in the section.

//{invoice_line.invoice_line_type} = [928, 929, 930]
//OR
//{invoice_line.item_id} = 'FINANCE CHARGE'

in select expert

{invoice_hdr.invoice_date} in {?Beginning Date} to {?Ending Date} and
{address.delete_flag} = "n" and
{invoice_hdr.customer_id} like ["11591", "23530"] and
{invoice_line.item_id} in ["DURAC MN1300", "DURAC MN1400", "DURAC MN1500", "DURAC MN1604", "DURAC MN2400", "RAY 6V-HD", "RAY AL-9V", "RAY AL-AA", "RAY AL-AAA", "RAY AL-C", "RAY AL-D"]

When i am trying to sum the extended price for these specific item id's it is not correct. the qty's and price equal the ext price. but when summing it, it is not correct.

trying to figure out where to stick this if it is correct

if {invoice_line.invoice_line_type} = [928, 929, 930] then {invoice_line.extended_price} else 0

But it tell me it should be a boolean

 
Try changing this:

if {invoice_line.invoice_line_type} = [928, 929, 930] then {invoice_line.extended_price} else 0

to this:


if {invoice_line.invoice_line_type} in [928, 929, 930] then {invoice_line.extended_price} else 0

-Dell

DecisionFirst Technologies - Seven-time SAP BusinessObjects Solution Partner of the Year
 
this will be placed in the section correct?
 
still getting the "formula result must be a Boolean
 
No, it doesn't go into the section. It's created in the regular formulas in the Field Explorer and doesn't specifically get places on the report. You then sum this formula instead of the field to get the sum that you're looking for.

-Dell

DecisionFirst Technologies - Seven-time SAP BusinessObjects Solution Partner of the Year
 
clearwater_j4le3a.png


when adding if {invoice_line.invoice_line_type} in [928, 929, 930] then {invoice_line.extended_price} else 0

it still is 0 when summed. i have added a screen shot for your reference.
 
the line type 0 is the actual number im trying to sum. so when i take the others out 930, 928, ect and put 0 in there it totals fine. just it is totaling everything, even what is not showning. i only need it to total what is visibly showing and it is driving me batty.
 
What version of Crystal are you using? If you'll save the .rpt with data and email it to me, I'll take a look at it (You can go to my website - - to get my email address.)

-Dell

DecisionFirst Technologies - Seven-time SAP BusinessObjects Solution Partner of the Year
 
I think I know what the issue is, change the formula to this:

if ({invoice_line.invoice_line_type} in [928, 929, 930] or {invoice_line.item_id} = 'FINANCE CHARGE') then 0 else {invoice_line.extended_price}

I think I had it backward.

-Dell

DecisionFirst Technologies - Seven-time SAP BusinessObjects Solution Partner of the Year
 
i not sure of the problem. it is still doing the same thing. it will not just sum the visible ext price
 
what do you know about WhilePrintingRecords
 
You could try putting that as the first line of the formula we've been working on and see if that will solve the problem.

-Dell

DecisionFirst Technologies - Seven-time SAP BusinessObjects Solution Partner of the Year
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top