Hi
the problem is, subtracting from the first list will then cause Mendix to change the list into distinct entities. IN my own example my initial list was 6000 items. after subtracting 1 item, it changed into a list of 1000 odd distinct items and now I cannot count how many of each type.
So, if I have a list of fruit, 3 apples, 2 pears and a banana. If I want to count how much of each, it isn't possible to filter on the first item (apples), find out there are three, then, remove these three from the list, and then go on to the next one.
What I can do is loop through the entire list one by one and create running totals of each. However, this surely can't be the most efficient approach. It feels like this automatic refactoring of the list into distinct entities is not the correct behaviour. This should only occur if required by the user surely
Hello Joe,
Go through each item in the first list one by one. For each item, see if it’s also in the second list. If it is, take that one item out from the first list. In this way, you only remove the exact number of matching items and also track the number of times.
Best regards,
Monika.