Hi all,
I created a horizontal bar in Kibana using Vega-lite which works fine (Kibana v6.2.3). Next task was to add ranking so that I can filter the results based on their rank. This seems to be trickier as I cannot seem to make it work and I receive error
Ignoring an invalid transform: {"sort":[{"field":"1.value","order":"descending"}],"window":[{"as":"rank","op":"rank"}]}.
Below is the JSON.stringify(VEGA_DEBUG.vegalite_spec) export from the browser:
"{"$schema":"https://vega.github.io/schema/vega-lite/v2.json","title":"Daily Data","data":{"format":{"property":"aggregations.3.buckets"},"values":{"took":33,"timed_out":false,"_shards":{"total":20,"successful":20,"skipped":0,"failed":0},"hits":{"total":32403,"max_score":0,"hits":},"aggregations":{"3":{"doc_count_error_upper_bound":0,"sum_other_doc_count":0,"buckets":[{"1":{"value":16367.13454108499},"key":374150,"doc_count":2610},{"1":{"value":80775.62767555192},"key":369854,"doc_count":15175},{"1":{"value":2526.117695760913},"key":0,"doc_count":14618}]}}}},"transform":[{"window":[{"op":"rank","as":"rank"}],"sort":[{"field":"1.value","order":"descending"}]},{"filter":"datum.rank <= 5"}],"layer":[{"mark":{"type":"bar"},"encoding":{"y":{"field":"key","type":"ordinal","axis":{"title":"Id"}},"x":{"field":"1.value","type":"quantitative","axis":{"title":"Amount"}}}}],"config":{"range":{"category":{"scheme":"elastic"}},"mark":{"color":"#00A69B"}},"autosize":{"type":"fit","contains":"padding"}}"
The transform snippet was copied from the top rank example available here:
Any ideas will be greatly appreciated!