Transforming tables into 2D matrix representation and vice versa.....
684220Dec 8 2010 — edited Dec 9 2010Hello Gurus,
I am now facing a problem that is somehow confusing me. I am trying to transform any given table into a 2D matrix representation. The reason I am doing that is because I need to split the table into 4 parts by making use of the coordinate attribute of a matrix which refers a plan by the number of steps (columns in our case) in the x-axis and number of steps (rows in our case) in the y-axis.
So for example if we have the department table having the following representation:
DEPARTMENT_ID DEPARTMENT_NAME MANAGER_ID LOCATION_ID
10 Administration 200 1,700
20 Marketing 201 1,800
30 Purchasing 114 1,700
40 Human Resources 203 2,400
50 Shipping 121 1,500
60 IT 103 1,400
70 Public Relations 204 2,700
80 Sales 145 2,500
90 Executive 100 1,700
100 Finance 108 1,700
I need to slit this into 4 parts. So the part 1 plan should have the values lying between coordinates (0,0) to (1,0) and (0,0) to (0,4) :
DEPARTMENT_ID DEPARTMENT_NAME
10 Administration
20 Marketing
30 Purchasing
40 Human Resources
50 Shipping
Part 2 plan should lie between (2,0) to (3,0) and (2,0) to (2,4):
MANAGER_ID LOCATION_ID
200 1,700
201 1,800
114 1,700
203 2,400
121 1,500
Part 3 plan should lie between (0,5) to (1,5) and (0,5) to (0,9):
DEPARTMENT_ID DEPARTMENT_NAME
60 IT
70 Public Relations
80 Sales
90 Executive
100 Finance
Part 4 plan should lie between (2,5) to (3,5) and (2,5) to (2,9):
MANAGER_ID LOCATION_ID
103 1,400
204 2,700
145 2,500
100 1,700
108 1,700
Then after splitting these into the parts i should be able to get the original representation of the table by making use of the coordinates where the parts were split about.
I'd be glad to get some help over here.
Cheers.