Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lens] Display last n values #151453

Closed
maximekuntz opened this issue Feb 16, 2023 · 5 comments
Closed

[Lens] Display last n values #151453

maximekuntz opened this issue Feb 16, 2023 · 5 comments
Labels
enhancement New value added to drive a business result Feature:Lens feedback_needed impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@maximekuntz
Copy link

We can currently display on a lens the $n$ first values of a field (in a breakdown) e.g. the 6 top values on the following image.
image

Could we have the same to display the last $n$ values ?

@botelastic botelastic bot added the needs-team Issues missing a team label label Feb 16, 2023
@stratoula stratoula added enhancement New value added to drive a business result Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. labels Feb 16, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Feb 16, 2023
@stratoula
Copy link
Contributor

@maximekuntz the top values depend on the ranking you are selecting. Check the elasticsearch documentation here https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-order

In your example you are ranking them alphabetically (ordering by the term value). If you order them by the metric then it will return the top n terms ordered by this metric. If you change this to ascending it will sort the terms by the lowest first and return the top n.

Ordering is not guaranteed to return correct results as you see in the documentation. You can improve by enabling the accuracy setting.

But maybe I don't understand your request correctly. What do you mean with the last n values?

@maximekuntz
Copy link
Author

@stratoula You are right, I did not detail the exact point.

Let consider the following example: we have terms, A, B, C, D, E, F, G, H, I, J.
Currently, we can sort in ascending order and take the top 6 value. It returns (in this order): A, B, C, D, E, F.
image

And if I sort in descending order and take the top 6 value, it returns (in this order): J, I, H, G, F, E.
image

I would like to have E, F, G, H, I, J i.e. displayed in ascending (alphabetical) order.

I hope it is clearer.

@dej611
Copy link
Contributor

dej611 commented Mar 9, 2023

I think this is a duplicate of #86184 then.
In Lens it is only possible to "rank" Top values data, then the visualization will render with the same order as in the data response. The linked issue is about providing more control on UI sorting of the data.

@stratoula
Copy link
Contributor

Got it! This is not possible atm but we have an issue open for that #86184 (allow client side sorting per dimensions). I think this is going to solve this case. I wil close this issue in favor of the one I posted. Thanx for explaining!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Lens feedback_needed impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

4 participants