We consider a system of weakly coupled wires with quantum Hall effect (QHE) and in the presence of a spatially periodic modulation of the chemical potential along the wire, equivalent to a charge density wave (CDW). We investigate the competition between the two effects which both open a gap. We show that by changing the ratio between the amplitudes of the CDW modulation and the tunneling between wires, one can switch between non-topological CDW-dominated phase to topological QHE-dominated phase. Both phases host edge states of chiral and non-chiral nature robust to on-site disorder. However, only in the topological phase, the edge states are immune to disorder in the phase shifts of the CDWs. We provide analytical solutions for filling factor $\nu=1$ and study numerically effects of disorder as well as present numerical results for higher filling factors.