Hello, Marta.
Thanks for your reply. Unfortunately, the data that you used is not structured is the same way as mine. In your example, you could have multiple instances of category.keyword in the same record (basically, multiple products of different types). For my example, imagine that I have just one occurence of category.keyword in my record.
To use your data in my example, let's assume a customer bought a product from "Men's accesories" and one product from "Men's clothing". In my example, this would produce 2 records, each one with its own category.keyword field (see below an example of what I am reffering to):
{
"_index" : "kibana_sample_data_ecommerce",
"_type" : "_doc",
"_id" : "2-dm8nsBcBtKmSN2zsMN",
"_score" : 0.0,
"_source" : {
"currency" : "EUR",
"customer_first_name" : "Sultan Al",
"customer_full_name" : "Sultan Al Thompson",
"category" : "Men's Clothing",
"customer_gender" : "MALE",
"customer_id" : 19,
"customer_last_name" : "Thompson",
"customer_phone" : "",
"day_of_week" : "Tuesday",
"day_of_week_i" : 1,
"email" : "sultan al@thompson-family.zzz",
}
},
{
"_index" : "kibana_sample_data_ecommerce",
"_type" : "_doc",
"_id" : "2-dm8nsBcBtKmSN2zsMN",
"_score" : 0.0,
"_source" : {
"currency" : "EUR",
"customer_first_name" : "Sultan Al",
"customer_full_name" : "Sultan Al Thompson",
"category" : "Men's Accessories",
"customer_gender" : "MALE",
"customer_id" : 19,
"customer_last_name" : "Thompson",
"customer_phone" : "",
"day_of_week" : "Tuesday",
"day_of_week_i" : 1,
"email" : "sultan al@thompson-family.zzz",
}
}
So, for my example, this client would have to be labeled as "Hybrid" in my pie-chart.
For my final pie-chart I have to count:
- How many customers bought products from both "Men's acessories" and "Men's clothing" - these customers are Hybrid.
- How many customers bought only from "Men's acessories"
- How many customers bought only from "Men's clothing".
Thanks.
Alex