purchases[amount <= median(amount)*10][, .(total = sum(amount - discount)), by = .(country)][order(country)]
```
- no quotes needed - no loc needed - only 1 groupby needed