You have a table with empty cells in some columns ('Unit 4' and 'Unit 5' for our example). You need to normalize the table: get rid of the empty cells and "move up" cells with data.
Enter the following SQL query:
CREATE TABLE TU4; INSERT INTO TU4 SELECT T1.'Unit 4', ROWNUM(*) as '#' FROM T1 WHERE T1.'Unit 4' != 0; CREATE TABLE TU5; INSERT INTO TU5 SELECT T1.'Unit 5', ROWNUM(*) as '#' FROM T1 WHERE T1.'Unit 5' != 0; SELECT T1.'Record #', T1.'Unit 1', T1.'Unit 2', T1.'Unit 3', TU4.'Unit 4', TU5.'Unit 5' FROM T1 LEFT JOIN TU4 ON T1.'Record #' = TU4.'#' LEFT JOIN TU5 ON T1.'Record #' = TU5.'#' |
Save the macro and the page.