I am not sure what you are trying to acheive based on your script. But if it is what you say in the text you can try this:
Replace LOAD *,
IF(Not IsNull(DATE_1),1) &
IF(Not IsNull(DATE_2),2) &
IF(Not IsNull(DATE_4),4) &
IF(Not IsNull(DATE_6),6) &
Since I have not access to your source file I just added the code above and took a partial reload based on the data you had in the app. It seems to work. You don't need the qualify commands nor the Replace load.
Attached is the code you can test with a partial reload.
CalendarDate_v2.qvw 581.0 K
or more generic:
table2: CrossTable (colnam, colval,2) LOAD STORE_ID, DATE, DATE_1, DATE_2, DATE_4, DATE_6, DATE_7 Resident table1; table3: LOAD STORE_ID, DATE, Concat(SubField(colnam,'_',2)) as STORE_STATE Resident table2 Where Len(colval) Group By STORE_ID,DATE; DROP Table table2;
hope this helps