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!

When value returned by formula is zero

Status
Not open for further replies.

PJOL

IS-IT--Management
Oct 11, 2005
28
0
0
IE
A report I have for conversions uses a formula in the details section, i.e.

whileprintingrecords;
If{PRODUCT_MASTER.IC_UNIT_REQUIRE}={PART_UOM_CONVERSIONS.UNIT_FROM} and
{PLANNING_JOB_STAGE_LINES.INPUT_UNIT}={PART_UOM_CONVERSIONS.UNIT_TO} and
{PART_UOM_CONVERSIONS.UOM_CONVERSION_FACTOR}>0 and
{PART_UOM_CONVERSIONS.SYS_CONV_METHOD} = "M" Then
(
({PLANNING_JOB_STAGE_LINES.INPUT_QTY_STD_BATCH}/{PART_UOM_CONVERSIONS.UOM_CONVERSION_FACTOR})
)

Else If{PRODUCT_MASTER.IC_UNIT_REQUIRE}={PART_UOM_CONVERSIONS.UNIT_TO} and
{PLANNING_JOB_STAGE_LINES.INPUT_UNIT}={PART_UOM_CONVERSIONS.UNIT_FROM} and
{PART_UOM_CONVERSIONS.UOM_CONVERSION_FACTOR}>0 and
{PART_UOM_CONVERSIONS.SYS_CONV_METHOD} = "D" Then
(
({PLANNING_JOB_STAGE_LINES.INPUT_QTY_STD_BATCH}*{PART_UOM_CONVERSIONS.UOM_CONVERSION_FACTOR})
)

I am getting duplicate lines in the details section when the output returned by: ({PLANNING_JOB_STAGE_LINES.INPUT_QTY_STD_BATCH}/{PART_UOM_CONVERSIONS.UOM_CONVERSION_FACTOR}) or the output returned by:({PLANNING_JOB_STAGE_LINES.INPUT_QTY_STD_BATCH}*{PART_UOM_CONVERSIONS.UOM_CONVERSION_FACTOR}) is zero. If these lines were "suppressed" or "filtered" then the report would be ok from what I can see.

Any help appreciated.
 
Go to the section expert->details->suppress->x+2 and enter:

{@yourformula} = 0

-LB
 
It should prove faster and allow for proper aggregates to ufilter the rows from the database.

Go to Report->Selection Formula->Record (menu will vary, you didn't bother to post your software version...):

(
({PLANNING_JOB_STAGE_LINES.INPUT_QTY_STD_BATCH}
/{PART_UOM_CONVERSIONS.UOM_CONVERSION_FACTOR})<> 0
)
and
(
({PLANNING_JOB_STAGE_LINES.INPUT_QTY_STD_BATCH}*{PART_UOM_CONVERSIONS.UOM_CONVERSION_FACTOR}) <> 0
)

This should pass to the database (depends on the database/connectivity used, again, post basic information, if you have databsaes involved, post what you are using and how you are connecting) and filter the rows, even if it doesn't pass, the rows will be filtered and no suppression will be required within the report.

In general, offload processing to the database rather than embedding rules in the client. Use Views or Stored Procedures for maximum reusability and easier maintenance.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top