Expression Problem

Hello Everyone,

Just trying to make something a little more user friendly.

So I have a maintenance program, and in this program users can connect parts to certain machines so that when they perform maintenance they have a limited number of parts to select from (Only parts that have been connected to the machine) as opposed to a massive list of all parts. Problem is somtimes they are connecting the same part to the machine more than once.

My expression for selecting a part. More Like @Steve expression when I was just beggining to make apps.

ORDERBY(
SELECT(
   Parts[ID], 
   
    OR(
      ISBLANK([_THISROW].[Part Catagory]),
      ([_THISROW].[Part Catagory] = [Part Catagory])
    )
)
, [Part Name], false) 

Now, what im looking to do is to only show parts that have not been conented to the machine already. The machine name column is already filled in before they can select a part, so we know what machine the user is dealing with. Just how would I sort the list so that only parts that have not already been connected to the [_THISROW].[Machine Name] are shown?

You must be storing which parts have already been added to the machine somewhere, so just do list subtraction.

List of all parts - already attached parts.

1 Like

Yes ok,you see, this is something I don’t fully understand yet. I also heard this is something that is working right now but may not be working in the future?

Yes in the same table as they are adding to, I have all the connected machines along with all connected parts.

So With this

SELECT(Machine Parts[part name],[_THISROW].[Machine name]=[machine name])

I get a list of parts in the machine parts table currently connected to the selected machine, How would I implement this into my existing formula and subtract these parts from it?

List addition and subtraction I doubt would be going anywhere.

ORDERBY(
SELECT(
   Parts[ID], 
    OR(
      ISBLANK([_THISROW].[Part Catagory]),
      ([_THISROW].[Part Catagory] = [Part Catagory])
    )
) - SELECT(Parts[ID],[_THISROW].[Machine name]=[machine name])
, [Part Name], false)
4 Likes

Well that works perfectly.

1 Like