Now,We hive a table of Consumption details.(A person has multiple consumption records ).
First ,we want to Calculate a person's total consumption(need to agg).
Then we want to get all the people who consume more than $500.(It's the total, not the details.).
So we need to aggregate twice on the basis of calculating a person's total consumption amount.
Like the sql:
select count(1)
from (select *
from (select mobile_nbr, sum(trans_amt) total_trans_amt
from activity_detail
group by mobile_nbr) t
where t.total_trans_amt > 500) tt
@abdon
hello,thanks for your answer.
I had tried the bucket selector aggregation.But the result is the details are not the total.
I want to get the number of people that is not people's details.
Can we get the result~
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.