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

Allow average on boolean #10213

Closed
Tracked by #179200
champtar opened this issue Feb 7, 2017 · 2 comments
Closed
Tracked by #179200

Allow average on boolean #10213

champtar opened this issue Feb 7, 2017 · 2 comments
Labels
Feature:Aggregations Aggregation infrastructure (AggConfig, esaggs, ...) Feature:Lens impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@champtar
Copy link

champtar commented Feb 7, 2017

Hi,

Kibana currently only accept to use avg on numbers, but it can also make sense on boolean:
I have an is_hit boolean in my index/mapping, avg of is_hit is my hit ratio (false = 0, true = 1)
Elasticsearch already support this, just need to lift the restriction in Kibana

for now as an ugly workaround i'm using a scripted field

return doc['is_hit'].value ? 1 : 0;

Regards
Etienne

@tbragin tbragin added Feature:Aggregations Aggregation infrastructure (AggConfig, esaggs, ...) Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:enhancement labels Feb 8, 2017
@champtar
Copy link
Author

This allow average on boolean, but it need way more love for correct formating (in percent for exemple)

--- a/src/ui/public/agg_types/metrics/avg.js
+++ b/src/ui/public/agg_types/metrics/avg.js
@@ -12,7 +12,7 @@ export default function AggTypeMetricAvgProvider(Private) {
     params: [
       {
         name: 'field',
-        filterFieldTypes: 'number'
+        filterFieldTypes: 'number,boolean'
       }
     ]
   });

@timroes timroes added Team:Visualizations Visualization editors, elastic-charts and infrastructure and removed Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Visualizations Generic visualization features (in case no more specific feature label is available) labels Sep 16, 2018
@stratoula stratoula added impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. Feature:Lens labels May 26, 2023
@timductive
Copy link
Member

Closing this because it's not planned to be resolved in the foreseeable future. It will be tracked in our Icebox and will be re-opened if our priorities change. Feel free to re-open if you think it should be melted sooner.

@timductive timductive closed this as not planned Won't fix, can't repro, duplicate, stale Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Aggregations Aggregation infrastructure (AggConfig, esaggs, ...) Feature:Lens impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

5 participants