How do you subtract one list of numbers from another list

Hi Bubblers
I feel this is very simple but it’s over 40c/106f today here in the UK(!) and the heat is probably affecting my brain so please bear with me…
Here’s a mock up of what I’m doing (I’d love to share the actual app but it contains confidential info)…

Screen Shot 2022-07-19 at 15.04.54

Basically, a customer can order various quantities of different items that they then come to collect. They often won’t collect all the items in an order at once.

I’ve stored the Quantity as a “List of Numbers” and the “NumberCollected” is also a “List of numbers”.

I now want to subtract the number in Collecting from the numbers in Qty and save that as a new list that will tell me how many Remaining items there are to be collected next time. I’ve spent the last hour failing to do this because I was using “Minus List” because I’m an idiot working in the heat and I thought that was for subtracting numbers.
Can anyone tell me how to do this? I would appreciate it. I will be away for a few minutes trying to cool down.

Hi @joefarrowsmith,
Do you know your maximum number of Items in your Order? If it is not very large number you can try something like this - substract each element separatly, and continue to your max number of items in Your order. Or calculate this with JavaScript code.

Many thanks for taking the time to look into this for me. My apologies for a tardy response!
I learned a lot from your input here and, funnily enough, it’s given me some thoughts for a different issue I was having!
In the end, with the particular issue I was posting here, I managed to cobble a solution together by generating lists and Custom Sets and using conditions on those.
Many thanks again for your help though
All the best

1 Like