I understand the command xtile ... , nq(10) can create deciles based on the entire data-set being aggregated, but as far as I am aware, it cannot be used in conjunction with a bysort.

For example, I want to create deciles based on the month of June, where my data is monthly and ranges from 1990-2000. What would I do in that case?