L
L
ligisayan2016-01-19 17:50:39
Macros
ligisayan, 2016-01-19 17:50:39

How to combine products with the same names into 1?

Hello! There is a .csv file with a large list of products. Some of the products are grouped one after another and differ by one field (in fact, this is the same product that has different properties).

ID  NAME    PRICE   DESC
3630     лодка Адмирал 280  80.0000 св 1
3630     лодка Адмирал 280  80.0000 св 2
3630     лодка Адмирал 280  80.0000 св 3

How to combine such products into one, writing all the different fields into one type: sv 1; sv 2; sv 3?
ID  NAME    PRICE   DESC
3630     лодка Адмирал 280  80.0000 св 1;св 2;св 3

I try to write in a column like this =IF(A2=A1;B101894&"; "&X2;X2) and multiply to all rows, but I get a warning about a circular reference.. Why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Skobkin, 2016-01-19
@skobkin

The answer is obvious, there are at least three options:

  • Initially hash and combine data with the same key (fast, but a lot of memory and few queries to the database)
  • Process records one at a time, each time checking in the database if there is already such a record (slow, low memory, many queries to the database)
  • If possible, sort the records, and then go through the list, checking if the record matches the previous one and taking appropriate actions (quite fast, depending on the sorting method, it may take a lot of memory at the beginning or not, few queries to the database)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question