INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Sum visible only data

Sum visible only data

(OP)
I am trying to sum a field, but i only want the sum of the visible selection. help please.

RE: Sum visible only data

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
www.decisionfirst.com

RE: Sum visible only data

(OP)
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

RE: Sum visible only data

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
www.decisionfirst.com

RE: Sum visible only data

(OP)
this will be placed in the section correct?

RE: Sum visible only data

(OP)
still getting the "formula result must be a Boolean"

RE: Sum visible only data

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
www.decisionfirst.com

RE: Sum visible only data

(OP)


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.

RE: Sum visible only data

(OP)
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.

RE: Sum visible only data

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 - www.dellstinnett.com - to get my email address.)

-Dell

DecisionFirst Technologies - Seven-time SAP BusinessObjects Solution Partner of the Year
www.decisionfirst.com

RE: Sum visible only data

(OP)
emailed. thanks

RE: Sum visible only data

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
www.decisionfirst.com

RE: Sum visible only data

(OP)
i not sure of the problem. it is still doing the same thing. it will not just sum the visible ext price

RE: Sum visible only data

(OP)
what do you know about WhilePrintingRecords

RE: Sum visible only data

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
www.decisionfirst.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close