What is the correct "format" to display data per "per_cart" bucket? Anything deeper than aggregations.per_buyer.buckets returns the error "_.aggregations.per_buyer.buckets.per_cart is undefined" . VEGA_DEBUG.view.data shows that some aggregations.per_buyer.buckets have a per_cart object, which in turn have buckets. Filtering so that all buckets have per_cart objects does not change anything.
@Steven_Ensslen your format must be aggregations.per_buyer.buckets, simply because that's the list of data that you need. Each data element in that bucket may contain a sub-list of buckets which you have to access from Vega itself. Now, if the sub-list will always have just a single bucket (e.g. if you are summing-up the total per main bucket), you can access it either directly from a mark, e.g. datum.per_cart.buckets[0].net.value, or you can create a formula transform that would copy that value into a top level field, e.g. {type:'formula', as:'net_value', expr: 'datum.per_cart.buckets[0].net.value'}, and use the net_value field in the mark. If on the other hand you have multiple items in the sub-list, you could use the flatten transform to flatten out the sub-buckets into a non-hierarchical list of items, and then use various transformations to get the data into the format you need.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.