Let $q=e^{2\pi i/m}$, $a\in\mathbb{R}$ and $1\leq j\leq m-1$. I would like to prove that: $$(a-1)\sum_{n=0}^{m-1} q^n\frac{\prod_{k=0}^{j-2} (q^{n+k+1}-a)}{\prod_{k=0}^{j} (aq^{n+k}-1)}=0.$$
For $j=1$ I can prove it by induction: the left-hand side of the expression factors as $$\frac{\prod_{1<d|m}\Phi_d}{aq^m-1}$$ where $\Phi_d$ is the $d$th cyclotomic polynomial and the product runs over all divisors of $m$ (besides $1$). For larger values of $j$ I cannot guess a formula. For small values of $m$ I have checked that it is true.
I can also verify this identity for several values of $a$, such as $0,1$ and $\infty$. The $(a-1)$ in the numerator is necessary as without it there is a pole at $a=1$.
Is this a known identity? Can anyone point me towards a proof of the general case?