TSVB terms visualization

Hi,
I'm fairly new to Kibana and I'm attempting to setup a visualization where I have fields of the form
("my_field_name" + "custom_part"):
my_field_name_custom_part1=true
my_field_name_custom_part1=false
... etc
What I want to achieve is to be able to group the field by terms and apply a filter only showing the count of desired variants of the field (e.g. I only want to visualize all occurrences of my_field_custom_part1).

However, grouping by terms in e.g. a TSVB table and later applying a filter in the dashboard only appears to allow sorting by either "count" or "asc/desc" order of the field which terms was applied to. Is there any way to limit the table results to only show my_field_custom_part1?
Note: The fields I want to filter on are selected from a custom drop down list

I'm not sure if its clear what I want to achieve but shoot me any questions if not :smiley:

I'm not 100% sure about the visualization you want to achieve, but using the "Aggregation based" visualization types it's possible to order the terms by a custom metric and you can use a metric based on any field in there. Does that help?

I think screenshots of the current state of your dashboard and a description of what you want to change would help me understanding your case.

In general, it's not possible to dynamically aggregate multiple fields based on a common name prefix in Kibana - you always have to pick the field to operate on. There are some ways around this, for example you could ingest a single document per dynamic part - instead of

{
  my_field_name_custom_part1: true,
  my_field_name_custom_part2: true
}

you could do

{ key: "my_field_name_custom_part1", value: true }
{ key: "my_field_name_custom_part2", value: true }

Hi, and thanks for your initial reply.
Re-structuring the data as you suggested did help with setting up most of the desired visualizations.
Regarding the ordering however, I do use filter ratios in TSVB. As it appears, filter ratios are not available in visualizations created from the "Aggregation" list. Is there any other way to ensure I only display what the global filter is currently set to? Seems like a pretty standard thing and I'm sure its possible somehow, maybe I'm just coming at the problem from the wrong direction.
Some images that might help:

Dropdown selecting desired field experiments.key.name as filter:
Skärmavbild 2021-04-19 kl. 14.37.30

Table created with TSVB using filter ratios, which ignores my gobal filter of expriments.key.name. Should show: "new_design" entry only
Skärmavbild 2021-04-19 kl. 14.37.45

I see, if you need filter ratios TSVB is the right choice at the moment.

TSVB visualizations should respect the global filter on dashboards. Is it possible there is a single document containing multiple values for for experiments.key? Keep in mind that Elasticsearch is flattening out nested objects, so a document like this

experiments: [
{ key: "new_promotion_pitch", value: 4 },
{ key: "new_design", value: 7 },
]

is interpreted like this in aggregations:

experiments.key: ["new_promotion_pitch", "new_design"],
experiments.value: [4, 7]

So it's not tying the key to the value in nested objects. To visualize that, the individual experiments should be separate documents.

That was actually the miss on my side, and the cause of the ordering not working as expected.
Thanks again for your help!

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