Question: I'm traying to get product sku that are displayed on the website with the category of that product.

Output:

```
+-------------+------------+
| sku         | category_n |
+-------------+------------+
|      855202 |      test1 |
|     87972_k |      test2 |
|      887997 |      test1 |
+-------------+------------+

```

I have look at these tables:

```
catalog_category_product
catalog_product_entity
catalog_category_entity
catalog_category_entity_varchar

```

The query give a lot of rows back for just one sku i get about 100 records back. i don't see which one is the right category that is active right now..

```
SELECT
    * 
FROM
    "catalog_category_product" as ccp 
JOIN
    "catalog_product_entity" as cpe ON "cpe.entity_id" = "ccp.product_id"
JOIN  
    "catalog_category_entity" as cat ON "cat.entity_id" = "ccp.category_id"
JOIN 
    "catalog_category_entity_varchar" as cv on cat.entity_id = cv."entity_id"

```

Answer: 
You probably want to use [combineLatest](http://reactivex.io/documentation/operators/combinelatest.html) instead

```
BehaviorSubject<Map<int, String>> subject = BehaviorSubject(seedValue: {
  1: "Hi from 1",
  2: "Hi from 2",
  3: "Hi from 3",
  4: "Hi from 4",
  5: "Hi from 5",
});

void main() {
  Observable.combineLatest2(
      Observable.just([1, 2, 3, 4, 5]), subject.stream, combiner)
    ..listen(
      (data) {
        print("List of data incoming $data");
      },
    );
}

Iterable<String> combiner(List<int> indexes, Map<int, String> map) {
  return indexes.map((index) => map[index]);
}

```
**Edit**: shortly after posting this I realized that it completely depends on how the data is exposed:

If you have a method which has a signature like `Observable<String> getStringForInt(int number)` and you have to call it for every item in the list, my solution is the one for you. **Note** if the above method always subscribes to the same stream, changing that stream will result in multiple emissions (because combineLatest updates every item).

However, if you have access to the whole data container (like a Map

**Original Answer**

Ok, it turns out, it wasn't quite possible to achieve that with the implementation of rxDart. 

The `combineLatest` constructor only supported up to 9 streams.

But since then, combineLatest with n-streams has been implemented and the solution to this problem would look something like this:

```
Map<int, BehaviorSubject<String>> subject2 = {
  1: BehaviorSubject<String>(seedValue: "Subject 1"),
  2: BehaviorSubject<String>(seedValue: "Subject 2"),
  3: BehaviorSubject<String>(seedValue: "Subject 3"),
  4: BehaviorSubject<String>(seedValue: "Subject 4"),
  5: BehaviorSubject<String>(seedValue: "Subject 5"),
};

void main() async {

  Observable.fromIterable([1, 2, 3, 4, 5])
      .toList().asObservable()
      .flatMap((numbers) =>
      Observable.combineLatest<String, List<String>>(numbers.map((index) => subject2[index]), (strings) => strings))
      .listen((data) {
    print("List of data incoming $data");
  });

  await Future.delayed(Duration(seconds: 2));
  subject2[1].add("I'm 42 now");
}

```

This will print:

```
List of data incoming [Subject 1, Subject 2, Subject 3, Subject 4, Subject 5]
List of data incoming [I'm 42 now, Subject 2, Subject 3, Subject 4, Subject 5]

```