Avg(metric) > some value, return all rows where some metric changed by constant over a given period

Hi guys
I am new to druid. I was wondering if I can do the following
1: Return all ids where Avg(amt) >= 20 (granularity all)
here i should get EK1, EK5, EK4
2: Return all ids where amt changed by 5 for a given period (from 01/20 to 01/22)?
here i should get EK1, EK2, EK4

My values are as follows:

{“id”:“EK1”,“country”:“US”,“timestamp”:“2017-01-20T00:00:00.000Z”,“amt”:10,“rating”:“A”}

{“id”:“EK1”,“country”:“US”,“timestamp”:“2017-01-21T00:00:00.000Z”,“amt”:20,“rating”:“A”}

{“id”:“EK1”,“country”:“US”,“timestamp”:“2017-01-22T00:00:00.000Z”,“amt”:30,“rating”:“A”}

{“id”:“EK2”,“country”:“GB”,“timestamp”:“2017-01-20T00:00:00.000Z”,“amt”:5,“rating”:“B”}

{“id”:“EK2”,“country”:“GB”,“timestamp”:“2017-01-22T00:00:00.000Z”,“amt”:15,“rating”:“B”}

{“id”:“EK5”,“country”:“IND”,“timestamp”:“2017-01-21T00:00:00.000Z”,“amt”:30,“rating”:“A”}

{“id”:“EK3”,“country”:“JPN”,“timestamp”:“2017-01-20T00:00:00.000Z”,“amt”:10,“rating”:“C”}

{“id”:“EK3”,“country”:“JPN”,“timestamp”:“2017-01-22T00:00:00.000Z”,“amt”:12,“rating”:“C”}

{“id”:“EK4”,“country”:“CH”,“timestamp”:“2017-01-20T00:00:00.000Z”,“amt”:30,“rating”:“A”}

{“id”:“EK4”,“country”:“CH”,“timestamp”:“2017-01-22T00:00:00.000Z”,“amt”:50,“rating”:“A”}