Thank you Colin,
I am still struggling.
TABLE_ORIGINAL was loaded by another user from some local QVDs. I do not have access to them. But I still see TABLE_ORIGINAL in Table Manager.
In the script, I put the following:
And QV gives me "Table not found" error.
From the manuals, I see that Resident only applies if you have the Load statement for TABLE_ORIGINAL before the Resident statement. But this is not my case. I cannot reload the TABLE_ORIGINAL because I do not have it anymore.
Create a new QVW document that does two simple script things:
STORE TABLE_ORIGINAL INTO TABLE_ORIGINAL.QVD (qvd);
Now you have the table that cannot be recreated in a QVD. Reload the original document whereby you get TABLE_ORIGINAL from the QVD. Then do a LEFT JOIN of this table to itself whereby you translate every company into a region using the TALBE_MAPPING.
Peter, many thanks! This approach works. Using your code, I can extract tables from another QVW.
However, being a QV newbie, I see this approach a bit awkward:
- the table is already available
- but we need to save the table externally
- and reimport it
Why duplicate the table that we already have in the original QVW file? Do you know of there is any other way to accomplish this without reexport? More in the stream like I replied to Colin above.