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!

NEED HELP WITH REPORT REQUEST!!!!

Status
Not open for further replies.

AnonymousJane

Technical User
Apr 13, 2001
8
0
0
US
This is the situation I have to figure out. I'm using Crystal v8.5, database is dbV (but can use the database that has been converted to SQL). I'm so confused!!!

Reman Sales: Any sale where the Orl_Price is not equal to E_Reman in the EXCH.dbf

New Product Sales: Any sale where the Orl_Price is not equal to E_COST x 1.335

This is the formula I came up with but I can't mix them together into one report? Am I doing something wrong here.

if not ({Order.OR_TYPE} in "S") and
{Orline.ORL_PRICE} <> {exch.E_REMAN} then
{exch.E_REMAN} - {Orline.ORL_PRICE} else
if ({Order.OR_TYPE} in &quot;S&quot;) and
{Orline.ORL_PRICE} <> ({exch.E_COST} * 1.335) then
({exch.E_COST} * 1.335) - {Orline.ORL_PRICE}


 
Try this:

//@PriceGroup
WhilePrintingRecords;
NumberVar PriceVar;

//Price Variable for Remanufactured Sales
If
{Order.OR_TYPE} <>&quot;S&quot; and
{Orline.ORL_PRICE} <> {exch.E_REMAN}
Then
PriceVar =: ({exch.E_REMAN} - {Orline.ORL_PRICE})
Else
//Price Variable for New Product Sales
If
{Order.OR_TYPE} = &quot;S&quot; and
{Orline.ORL_PRICE} <> ({exch.E_COST} * 1.335)}
Then
PriceVar =: (({exch.E_COST} * 1.335) - {Orline.ORL_PRICE})
Else
PriceVar =: 0;

//The returned Price Variable is:
PriceVar

Of course, based on the above formula I have a few questions:

1) What are you attempting to return as a result of this formula?

2) Have you already defined Groups based on Remanufactured and New Product Sales that would make the above formula meaningful? If so, you could use those formulas within the above formula so that it is less verbose.

3) Is it your intent to allow the potential for negative return values?
 
My boss wants to know who's getting a discount, and how much of a discount they're getting. He's in the middle of price reconstructuring and he wants to know who's going to whine first about the rate increase. So I guess technically the answer to #3 is yes.

This is how I have it so far:

a) I have two seperate columns with each seperate formula for each column; i.e.
@COST DIFFERENCE =
if not ({Order.OR_TYPE} in &quot;S&quot;) and
{Orline.ORL_PRICE} <> {exch.E_REMAN} then
{exch.E_REMAN} - {Orline.ORL_PRICE}

and
@COST DIFF E_COST =
if ({Order.OR_TYPE} in &quot;S&quot;) and
{Orline.ORL_PRICE} <> ({exch.E_COST} * 1.335) then
({exch.E_COST} * 1.335) - {Orline.ORL_PRICE}


THE MAIN FORMULA IS:
not {Order.OR_WARR} and
//OR_TYPE not like &quot;*R&quot; signifies that its not a recheck
not ({Order.OR_TYPE} like &quot;*R&quot;) and
//The following customers have set rates
not ({cust.C_CODE} in [&quot; 10587&quot;, &quot; 13800&quot;, &quot; 14944&quot;, &quot; 15948&quot;, &quot; 17103&quot;, &quot;817285&quot;]) and
//?Date is a date parameter
{invoice.IN_DATE} = {?Date}


 
I want to thank you for your help in this formula. It made me realize that I need to go back to school to take Algebra. That's the one subject I utterly hated in school. Once again Thank You!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top