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.

Calculation that changes when dealing with last repitition

Featured Replies

I've created 2 calculations to handle an interface issue and I was wondering if there was a way of "combining" the 2 calcs into 1. Here's the scenario:

In a solution I've created, a user sets up pricing structure of items based on quantities sold. Quantities 1-10 might cost $1.00/ea., quantities 11-25 might cost $.95/ea., an so on, all the way up to the last quantity break. I've created 2 calculations for the interface. One calc shows the value for the start of the next quantity range, along with some text. The other calc deals with the last qty range by returning the value of the start of that range, along with some text. Take a look at the attached example and this should all make better sense.

Since I have quantity breaks throughout the solution AND the number of quantity-break-ranges differs between certain items, I'd like to create 1 custom function that can be used in place of the 2 calcs I'm using now AND it would correctly deal with the last quantity range regardless of the number of repititions in the quantity break field (because the number of ranges varies with certain items).

I hope that the attached example will make more sense than my funky explanation ;)

Thanks in advance for any help you can offer!

UserInterfaceCalcs.zip

Does the following satisfy your requirements. I have looked at the file and it produces the values of the two functions in one.

Case(Get ( CalculationRepetitionNumber ) ≠ RightWords(FieldType ( Get(FileName); "quantityBreak" );1); "Qty:" & quantityBreak + 1 & "-";quantityBreak + 1 & " and up")

It works equally well with an If instead of a Case. The Case leaves the possibility of extending the calculation to allow more options.

  • Author

Thanks a lot, SlimJim. That's precisely what I needed to know. I'd never realized the usefulness of the FieldType() function before.

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.