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!

Using discounts (%) in formulas.

Status
Not open for further replies.

Claudio Trovisco

Technical User
Jun 6, 2017
1
PT
Good day to all,

I'm trying to calculate the price of an article applying a discount (%), i.e:

"Regular Price" - "Discount (%)" = "Price with discount"

I'm aware that it's not possible to use the discount value (x%)directly so I've come up with the following formula:

({Regular Price}-({Regular Price}*({Discount}/100))

However, when the discount is 0 (zero) the result of this last step is also 0(zero), resulting of the multiplication. Now, this is not what I'm looking for since the "regular price with a 0% (zero) discount should be exactly the same!

I appreciate all the help.

Thank you in advance

 
What is your actual formula? You have extra parentheses in the one above. The following should work:

{table.price}-({table.price}*{table.discount}/100)

-LB
 
Are you sure 0% discount is zero and not null. Try setting nulls to default in report options.
Or change formula to test for null replace discount field with formula
@discount
if isnull(discount) then 0 else discount

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top