Hi forum. I have two arrays array1 = {1;2;2;3} array2

Hi forum.

I have two arrays

array1 = {1;2;2;3}
array2 = {A;B;C;D}

I'd like to remove the duplicates from array1, so I use the union function, namely union (array1,array1). Now we have

array1 = {1;2;2;3}
array2 = {A;B;C;D}
array3 = {1;2;3}

What would be the best way to associate the second value in array3 with B and C in array2? Any help would be greatly appreciated
...

OriginalPostID-86494

OriginalPostID-86494

  Discussion posts and replies are publicly visible

Parents
  • To make it as simple as possible shelzle, in my situation array1 is a list of customers {customer1;customer2;customer2;customer3} and array2 is the data associated with these customers.

    So in this case, customer1 is associated with A, customer2 is associated with B and C and customer3 is associated with D. I have to send each customer an email with their specific data. If I sent out these emails based on array1, then customer2 will get two emails, when I actually want to send customer2 one email with B and C.

    This is why I created array3, but unfortunately if I send these emails based on array3, the customer2 will get one email with B.

    My intended outcome is for customer1 to receive an email with A, customer2 to receive an email with B and C and customer3 to receive an email with D. I hope this all makes sense. And obviously all three of these arrays will be of variable length.
Reply
  • To make it as simple as possible shelzle, in my situation array1 is a list of customers {customer1;customer2;customer2;customer3} and array2 is the data associated with these customers.

    So in this case, customer1 is associated with A, customer2 is associated with B and C and customer3 is associated with D. I have to send each customer an email with their specific data. If I sent out these emails based on array1, then customer2 will get two emails, when I actually want to send customer2 one email with B and C.

    This is why I created array3, but unfortunately if I send these emails based on array3, the customer2 will get one email with B.

    My intended outcome is for customer1 to receive an email with A, customer2 to receive an email with B and C and customer3 to receive an email with D. I hope this all makes sense. And obviously all three of these arrays will be of variable length.
Children
No Data