Let $x(n)$ be a sequence of length $N = LM, n = 0,\dots,N-1$.$N$ and $M$ are integers.
The Discrete Fourier Transform (DFT) of $x(n)$ is given by
$X(k) = \sum_{n = 0}^{N-1}x(n)W^{nk}_N$
where $W_N = e^{\frac{-j 2 \pi}{N}}$.
Let $n = l + mL$ and $k = q + pM$
$0 \le l,p \le L-1$, $0 \le m,q \le M-1$
$X(p,q) = \sum_{m = 0}^{M-1}(\sum_{l = 0}^{L-1}x(l + mL)W^{(l + mL)(q + pM)}_N)$.
$W^{(l + mL)(q + pM)}_N = W^{lq + lpM + mqL + mpLM}_N = W^{lq + lpM + mqL}_N$
Since $W^N_N = 1$.
$X(p,q) = \sum_{m = 0}^{M-1}\sum_{l = 0}^{L-1}x(l + mL)W^{lq + lpM + mqL}_N ... (1)$.
Why the above equation (1) can be written as $X(p,q) = \sum_{l = 0}^{L-1}\{W^{lq}_N \sum_{m = 0}^{M-1}x(l + mL)W^{mq}_M \} W^{lp}_L$
after summation interchange of indices $l$ and $m$.
Can you explain the method behind the the interchange of indices $l$ and $m$ in detail.
I have taken the above material from the book:Digital Signal Processing: Principles, Algorithms and Applications, 5th edition