Chart pie count field

hello,
I have a pie of count split terms and I want make addition of some fields of this aggregation
exemple i have count of (women , men ,child girls, child boy )
but i have to make pie with count of (women+ child girls) and (men +child boy)

how can i do this please ?

You would need to reindex your data and add another field like gender where you would set it to female if the first field is either women or child girls

you could also do that on-the-fly with scripted fields, however that will create a much bigger load and might not be appropriate if your dataset is big.

1 Like

Thank's for your answer can you give me exemple of scripted fileds similaire of my exemple please ?
in https://www.elastic.co/guide/en/kibana/current/scripted-fields.html
there is no exemple similaire to my case !

something like:

if (doc['field1'].value == 'women' || doc['field1'].value == 'girls') return 'female';
if (doc['field1'].value == 'men' || doc['field1'].value == 'boys') return 'male';
return 'n/a';
1 Like

hi,
my script filed work very good in visualize but when i call it in dashboard i have Error
"Could not locate that index-pattern-field (id: mynewscriptsfiledadd)"!

that's weird ... should not happen i think.

could you open an issue on http://github.com/elastic/kibana ?

1 Like

Yes, you are right it's should not happen , in my cas it's
Mishandling

thank's for your replay

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