Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Consider this table:
I would like to generate 3 new tables with the same fields ID's:
table1:
table2:
table3:
can anyone help me ? thanks!
Hm, you could separate your table into a table per record for example like this:
INPUT:
LOAD *, RowNo() as row INLINE [
items, stores, quantity
A, 1, 5
B, 1, 2
C, 10, 3
];
Let vMaxRow = Peek('row',-1,'INPUT');
For rowno = 1 to $(vMaxRow)
TABLE$(rowno):
NoConcatenate LOAD
items, stores, quantity
Resident INPUT where recno() = $(rowno);
next rowno
drop table INPUT;
But since you want to keep the field names the same (as I understood your original post), this will create a synthetic key and table that will link all tables. Still you can see (e.g. in table viewer, hovering with the mouse over the three created tables), that each table now holds only one record.
QV will link the fields automatically by equality of field names, and there is no way to stop QV from doing so.
But what are you trying to achieve? If you want to store the tables into separate files, fine, this should work.
But you probably want to do something with the tables in the front end, and I am unsure, what that could be.
There is probably a better solution for anything you want to do in the front end than separating the tables.
Regards,
Stefan
TY but I would like to do that in the script. Any idea ?
Hm, you could separate your table into a table per record for example like this:
INPUT:
LOAD *, RowNo() as row INLINE [
items, stores, quantity
A, 1, 5
B, 1, 2
C, 10, 3
];
Let vMaxRow = Peek('row',-1,'INPUT');
For rowno = 1 to $(vMaxRow)
TABLE$(rowno):
NoConcatenate LOAD
items, stores, quantity
Resident INPUT where recno() = $(rowno);
next rowno
drop table INPUT;
But since you want to keep the field names the same (as I understood your original post), this will create a synthetic key and table that will link all tables. Still you can see (e.g. in table viewer, hovering with the mouse over the three created tables), that each table now holds only one record.
QV will link the fields automatically by equality of field names, and there is no way to stop QV from doing so.
But what are you trying to achieve? If you want to store the tables into separate files, fine, this should work.
But you probably want to do something with the tables in the front end, and I am unsure, what that could be.
There is probably a better solution for anything you want to do in the front end than separating the tables.
Regards,
Stefan
TY!