Help

Re: Sum Only Minimum Values in an Array

965 0
cancel
Showing results for 
Search instead for 
Did you mean: 
AlliAlosa
10 - Mercury
10 - Mercury

Hi there! I’m trying to create a base to track employee clothing orders. Each employee, based on their title, gets a certain allotment of several types of clothing. For this example, say a manager is allotted 5 sweatshirts.

If that manager wants to get 7 sweatshirts, they certainly can, but they would be responsible for paying for the extra two.

Here’s where it gets tricky… If all sized sweatshirts were the same price, this would be pretty straight forward, but they aren’t. All sweatshirts over an XL have an upcharge (XXL adds $2.50, 3XL adds $3.50, and so on).

I want to determine how much the manager would owe if we pay for the 5 most expensive items.

Say the 7 values of the sweatshirts the manager chose are in an array… can I look at that array and only sum the 2 lowest value?

Table set up:

[Clothing Standards] determines what title gets what allotment
[Items] holds all Clothing items, sizes, and prices
[Clothing Orders] links to both [Clothing Standards] and [Items]. It counts how many of each item are chosen for a particular order and compares it to the standard allotments. Here is where I want to determine the price that the manager would owe.

Thank you in advance for any advice!

2 Replies 2

Heh…looks like your original post was approved. :slightly_smiling_face:

Hi - @AlliAlosa - see my reply on: