Jump to content

This topic is 7146 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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.

Posted

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

This topic is 7146 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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