Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Escalating Discounts Calculation

Featured Replies

Hi,

I have been struggling with this. I have a database of items for sale. Each item can have a constant discount, so "Widget A" always gets a discount of 10%, this of course is easy to calculate:

Price * Discount (.1)

But what if I wanted "Widget B" to have a 10% discount from 0-100 units, 15% from 101-500 units, 20% from 500+ units? Discount becomes a dynamic variable based on Quantity. Does anyone have any tips for this kind of calculation?

Edited by Guest

How about this?

A calculated field DiscountRate, defined by:

Case(Quantity < 101; 0.10 ; Quantity < 501 ; 0.15 ; 0.20)

Then a second calculated field, Discount, defined by:

Discount = DiscountRate * Price

  • Author

Cool, it's always more simple than I think.

If I could ask for one more bit of advice. What if those quantities (100 and 500) and those discounts (10, 15, 20) differ from product to product? "Widget C" could have a 30% discount only take effect at 10000+ units. I was thinking that the discounts and associated quantities could live in a different related table, that way each item could have any number of discounts. Any way to make that Case statement more portable/reusable?

Not calculation - lookup from a table of Discounts. See:

http://fmforums.com/forum/showtopic.php?tid/197517/

  • Author

I will take a look at that.

Thanks for the feedback.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.