# How best to visually represent attempted (and not-attempted) combinations?

**URL:** <https://discuss.elastic.co/t/how-best-to-visually-represent-attempted-and-not-attempted-combinations/285692>\
**Category:** Kibana\
**Created:** [October 1, 2021, 3:51pm UTC](https://discuss.elastic.co/t/how-best-to-visually-represent-attempted-and-not-attempted-combinations/285692 "2021-10-01T15:51:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cgmelastic](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cgmelastic](https://discuss.elastic.co/u/cgmelastic)\
**Post date:** [October 1, 2021, 3:51pm UTC](https://discuss.elastic.co/t/how-best-to-visually-represent-attempted-and-not-attempted-combinations/285692/1 "2021-10-01T15:51:19Z")

</div>

In a game I'm playing, there is a recipe book type thing. The ingredients for a recipe are known but not the specific quantity of each ingredient required to create the recipe, only a minimum and maximum value for each. The fact that there are no clues about quantities means that the number of possible combinations can reach the millions.

I have implemented a system which will specify a number for each ingredient, attempt the combination, and log the attempted combination as a JSON blob.

I have imported those logs into a dockerized kibana+elastic cluster. You can see a summary of the contents in the attached image.

Now for my question, **can anyone recommend a way for me to visualize this data** in a way that will

1. Track and allow me to understand my progress as I attempt to exhaust all possible combinations
2. Give me confidence that I have, in fact, exhausted all combinations

 ![Screenshot 2021-10-01 105734](https://us1.discourse-cdn.com/elastic/original/3X/9/f/9fa8be076dc51f945319d18bd115f753b13b2bea.png)

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [October 4, 2021, 9:41am UTC](https://discuss.elastic.co/t/how-best-to-visually-represent-attempted-and-not-attempted-combinations/285692/2 "2021-10-04T09:41:10Z")

</div>

Hi @cgmelastic,

to understand your use case, the pictures you've posted shows the attempts you've tried already, right?

In that case for 7 fields you have attempted: `1 * 1 * 19 * 1 * 16 * 1 * 4` = 1216 combinations already.

Do you know already how many distinct values are possible for each ingredient? Or just the `min`/`max`?  
In the latter case I suspect you can go with a uniform distribution for each ingredient (you may over-estimate the potential number of combinations), using a `max-min` interval computation.

Anyway, knowing the name of all fields, I guess you could use Lens to create 2 distinct visualizations:

- the first visualization as `metric`, and you could use the `Formula` feature to run the product above: `unique_values(fieldA) * unique_values(fieldB) * ...` =\> `1216`
- the second visualization can be a `metric` as well (or a bar chart using `Percentage` value format) with a Formula like:

```auto
unique_values(fieldA) * unique_values(fieldB) * ... /
(max(fieldA) - min(fieldA)) + (max(fieldB) - min(fieldB)) + ... + 0.000000001

```

note the final `0.0000001` to avoid the divide by 0 problem, which can be fixed with the `Percentage` formatting decimal unit, or avoided if you are sure that there's at least one ingredient which has a `max - min` value greater than 0.

In short: it's a bit long and explicit, but possible.

---

<div class="post-metadata">

**Author:** ![cgmelastic](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cgmelastic](https://discuss.elastic.co/u/cgmelastic)\
**Post date:** [October 4, 2021, 5:19pm UTC](https://discuss.elastic.co/t/how-best-to-visually-represent-attempted-and-not-attempted-combinations/285692/3 "2021-10-04T17:19:05Z")

</div>

Hi Marco, first of all thanks for replying. I figured starting off my post with "In a game I'm playing" might deter some from reading, glad you took an interest!

Each log entry is actually a distinct combination. Here's an example:

```auto
{
  "Amber": 27,
  "Page 6": 1,
  "Plate of metal": 28,
  "Ruby potion": 54,
  "Snake skin mesh": 22,
  "Tao stone": 1,
  "Yellow amber": 8
}

```

For this "recipe," there are actually `30*25*20*100*120*1` possible combinations (so 180m).  
Most items have a min & max and the value could, potentially, be any value where `min <= value <= max`.

I was fiddling with Heat Map this week, but my results were a little unreliable. I could create the map in the visualization editor but, once I saved it, I couldn't view it there or view it once added to a dashboard. This is close to what I was looking for though:

 ![unknown](https://us1.discourse-cdn.com/elastic/original/3X/f/4/f4e2eadfc687dc869c985bfe80e651222f995f05.png)

I like your ideas about using formulae to give progress-percentage indicators though... I'll have to think on that.

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [October 4, 2021, 5:23pm UTC](https://discuss.elastic.co/t/how-best-to-visually-represent-attempted-and-not-attempted-combinations/285692/4 "2021-10-04T17:23:08Z")

</div>

I think a heatmap is good to get the details of the missing combination.  
I proposed something as summary. Both ways can be useful I think.

---

<div class="post-metadata">

**Author:** ![cgmelastic](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cgmelastic](https://discuss.elastic.co/u/cgmelastic)\
**Post date:** [October 4, 2021, 5:27pm UTC](https://discuss.elastic.co/t/how-best-to-visually-represent-attempted-and-not-attempted-combinations/285692/5 "2021-10-04T17:27:20Z")

</div>

I think so too. Thank you for the help!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 1, 2021, 5:27pm UTC](https://discuss.elastic.co/t/how-best-to-visually-represent-attempted-and-not-attempted-combinations/285692/6 "2021-11-01T17:27:26Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
