| eval age_dist=floor(age/5)
This will give you a field named age_dist with distinct values for every 5 values of age
| eval age_range=case(age_dist==0,"(age)0-4",age_dist==1,"(age)5-9",...,age_dist==n,"(age)n*5-n*5+4")
This will give you the age groupings you are looking for
| stats count by product age_range
This will give you the table you are looking for
Your final search should look like:
... | eval age_dist=floor(age/5) | eval age_range=case(age_dist==0,"(age)0-4",age_dist==1,"(age)5-9",...,age_dist==n,"(age)n*5-n*5+4") | stats count by product age_range
Hope this helps
... View more