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

Crystal report - Subtract result for each item

Crystal report - Subtract result for each item

(OP)
Hi, I'm in the desperate need of help of experts like you guys.
On Crystal Report, I want to show My_Qty, which is {Table.1st_Qty}-{Table.2nd_qty}, for each item.

My desired outcome is

Item 1 5 0 5(My_Qty_1)
Item 2 6 0 6(My_Qty_2)

But my current CR shows

Item 1 5 0 11
Item 2 6 0 11
Is there anyway that I can adjust {Table.1st_Qty}-{Table.2nd_qty} to print out what I want?

I have tried 'Running Total Fields' but no luck.

And I've also tried the following, still not working.

WhilePrintingRecords;
{Table.1st_Qty}-{Table.2nd_qty}

I've been googling around but can't find an answer for my case. Thank you so much in advance!

RE: Crystal report - Subtract result for each item

Hi,

???

"{Table.1st_Qty}-{Table.2nd_qty}"

5-6=11???

Even us buba's in Texas know that 1) cast iron sinks, 2) pie are round and 3) 5-6 EQUALS MINUS ONE!

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Crystal report - Subtract result for each item

(OP)
Hi, SkipVought.

"{Table.1st_Qty}-{Table.2nd_qty}"
meant 5-0
or 6-0

Table.1st_Qty is 5 & Table.2nd_qty is 0.

whichever value that order is associated with.

Basically My_Qty_1 is {Table.1st_Qty}-{Table.2nd_qty}

And My_Qty_2 is {Table.1st_Qty}-{Table.2nd_qty}

The problem I'm phasing is that My_Qty_1,2,3... shows as sum of all "My_Qty"s. [(5-0)+(6-0) in this case]

Thank you for the response. I hope this would make sense. Sorry for the confusion.
Hope you stay cool in TX, here in Denver,Co is getting hotter too.

RE: Crystal report - Subtract result for each item

What are your table field names?

What is your SQL query code?

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Crystal report - Subtract result for each item

(OP)
@Backorder is

{ORDERHDR.QTYORDER}-{ORDERHDR.QTYTOTCOMMIT}.

Please feel free to ask me any follow-up question. Thank you so much for your help

RE: Crystal report - Subtract result for each item

Can you show actual values you are getting for each item for the fields, because as Skip says the maths does not make sense. Can't see how you are getting 11

{ORDERHDR.QTYORDER}and {ORDERHDR.QTYTOTCOMMIT}

When you gave us your desired outcome
Item 1 5 0 5(My_Qty_1)
Item 2 6 0 6(My_Qty_2)

Is this from details or a summary?

Ian

RE: Crystal report - Subtract result for each item

(OP)
Thanks for the reply Ian.

My actual values are the followings:

QtyOrder | Qty To Commit | My_Qty (=@BackOrder is {ORDERHDR.QTYORDER}-{ORDERHDR.QTYTOTCOMMIT} )

5 | 1 | 4
10 | 8 | 2
3 | 2 | 1


My current issue is that @Backorder shows as the sum of its values. (in this case 4+2+1 = 7)

QtyOrder | Qty To Commit | My_Qty (=@BackOrder)

5 | 1 | 7
10 | 8 | 7
3 | 2 | 7

And the fields, Qty Order, Qty To Commit, @Backorder are in 'Details'

Hope it helps and please feel free to ask me any follow-ups! Thank you so much!


RE: Crystal report - Subtract result for each item

Are you sure you have not inadvertently moved a sum Summary of @backorder into the details line.

Try deleting what you have an place the formula @backorder directly onto the detail section and do not add or perform any summaries.

Ian

RE: Crystal report - Subtract result for each item

(OP)
Thank you for the quick response!

All I've been doing is creating a formula {ORDERHDR.QTYORDER}-{ORDERHDR.QTYTOTCOMMIT} under Formula Fields as BackOrder.
And place it directly to the detail section.

I don't think I know how to do a sum Summary of @backorder.. (I'm new to Crystal Report.. )

Do you think I should use WhilePrintingRecords?

WhilePrintingRecords;
{ORDERHDR.QTYORDER}-{ORDERHDR.QTYTOTCOMMIT}

it is still giving me the same output though..

Any opinion would be highly appreciated! Thank you again

RE: Crystal report - Subtract result for each item

This is a shot in the dark, but your fields are from an Order Header table. I'm wondering whether there is a corresponding table for details and whether those fields are in the detail section already, but you are then using the wrong table fields in your formula. In other words, check the table that the detail fields are referencing and make sure that's the table you are using in your formula.

-LB

RE: Crystal report - Subtract result for each item

(OP)
Thank you for your response LB! I really appreciate that you took time to answer my question.

I've tried all other fields that is associated with qty, ex Qty To Pick, QtyCommit, TotQty.
But they seem to generate the same 'Sum' result.

I've loosing hope but I don't want to give up!

RE: Crystal report - Subtract result for each item

Please look at the qty field in the detail section and report back with the full name--including the table, as in {table.qty}.

-LB

RE: Crystal report - Subtract result for each item

(OP)
WOW LB you are amazing!!!

I had these three in detailed section : QtyOrder | Qty To Commit | My_Qty

And For QtyOrder, It's PacklistHDR.Quantity

While for My_Qty(@backorder), I was using, {ORDERHDR.QTYORDER}-{ORDERHDR.QTYTOTCOMMIT}

As soon as I changed My_Qty(@backorder) to {PacklistHDR.Quantity}-{ORDERHDR.QTYTOTCOMMIT},
it prints out the value that I want. Not the "sum" value anymore/

You are awesome. Thank you so much for your help and time!! I've been struggling with it for quite long... I was very dumb!


2thumbsup you deserve more than two thumbs!! thanks!

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