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

Not show suppressed details in sum

Status
Not open for further replies.

tonyvee1973

IS-IT--Management
Oct 22, 2009
156
GB
Hi ALl
Been on this for a day or so now and going around in circles so hope someone can advise?
I have a report where in the detail line I have a formula named "@f_qty" - this holds a formula as below:
if {SL_TRANSACTIONS.ST_TRANTYPE} = 'CRN'
then {ORD_DETAIL.OD_QTYINVD}*-1
else {ORD_DETAIL.OD_QTYINVD}

This returns me values for qty of product sold, however on some of those detail lines there are duplicates.
Not really straight forward as some duplicates are allowed as we sometimes have multiple lines on an order with the same stock code and qty - we would want to return these values.
However, there are some records which are full duplicates that need to be suppressed. These are records which duplicate stock code, qty and location.
The formula below is in section expert within details and suppresses these records ok:
{ORD_DETAIL.OD_STOCK_CODE} = Next({ORD_DETAIL.OD_STOCK_CODE}) And
{ORD_DETAIL.OD_ORDER_NUMBER} = Next({ORD_DETAIL.OD_ORDER_NUMBER}) And
{ORD_DETAIL.OD_LOCATN} = Next ({ORD_DETAIL.OD_LOCATN}) And
{@f_qty} = Next({@f_qty})

Now on to my issue which im sure is a simple one to some but driving me crazy.
I have inserted a summary for the "@f_qty" field but it sums all values even the suppressed ones. I've tried lots of stuff inc running totals etc but just keep making a mess of it, can someone help please?
attachment shows the incorrect sum.


 
 http://files.engineering.com/getfile.aspx?folder=b321477e-1664-4225-9e0b-0ddd26d391a6&file=demo.JPG
if {ORD_DETAIL.OD_STOCK_CODE} = Next({ORD_DETAIL.OD_STOCK_CODE}) And
{ORD_DETAIL.OD_ORDER_NUMBER} = Next({ORD_DETAIL.OD_ORDER_NUMBER}) And
{ORD_DETAIL.OD_LOCATN} = Next ({ORD_DETAIL.OD_LOCATN}) And
{@f_qty} = Next({@f_qty})
then 0
else
if {SL_TRANSACTIONS.ST_TRANTYPE} = 'CRN'
then {ORD_DETAIL.OD_QTYINVD}*-1
else {ORD_DETAIL.OD_QTYINVD}
 
Thanks Charliy but a bit confused on what I do with that formula?
I tried pasting it into the @f_qty formula but it errors as cannot point to itself
If I try to add as the suppress formula in the details section it errors as needs to be ab Boolean - any ideas?
 
You set this up as a separate formula, and then you do a sum of that formula.
 
Thanks again for this, however I tried that but no joy.
When I put you're formula in the details section of the report, when I right click and choose "Insert" it only gives me the option of field heading and not summary.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top