Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

igor_zhilin
New Contributor III

LOAD a [mapping] table IN ADDITION to already existing table

Dear Experts:

I still cannot find the solution to a simple problem.

1. I have a QV file, in which I have a table. Let's call the table TABLE_ORIGINAL. It does not matter where the data came from. What matters is: the TABLE_ORIGINAL is already in QV, and it cannot be reloaded from any external source.

2. I need to augment the TABLE_ORIGINAL with a mapping table. Let's call it TABLE_MAPPING. E.g. to allocate different companies from TABLE_ORIGINAL to regions coming from TABLE_MAPPING. Generally speaking, I need to add a mapping table.

3. But I need to load this TABLE_MAPPING and RETAIN the TABLE_ORIGINAL.

Of course if I just re-run the script with only MAPPING LOAD of TABLE_MAPPING, it will erase the TABLE_ORIGINAL.

How can I keep TABLE_ORIGINAL?

I saw this but was unable to find a case for my problem.

Types of loads in Qlikview

Thank you very much!

1 Solution

Accepted Solutions
igor_zhilin
New Contributor III

Re: LOAD a [mapping] table IN ADDITION to already existing table

Hi,

Indeed it helps!

1. I added TABLE_MAPPING: REPLACE LOAD... in the script;

2. Then I ran Partial reload;

Now I got TABLE_MAPPING in QV!

Will look into the doc you provided in more detail to see if I can get ApplyMap() to work with the TABLE_ORIGINAL.

6 Replies

Re: LOAD a [mapping] table IN ADDITION to already existing table

Use   Resident to load data from a table already in memory.

Re: LOAD a [mapping] table IN ADDITION to already existing table

Create a new QVW document that does two simple script things:

BINARY PathToYourOriginalQVWWithTABLE_ORIGINAL;

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.

Best,

Peter

igor_zhilin
New Contributor III

Re: LOAD a [mapping] table IN ADDITION to already existing table

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:

LOAD *

Resident TABLE_ORIGINAL;

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. 

igor_zhilin
New Contributor III

Re: LOAD a [mapping] table IN ADDITION to already existing table

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.

balkumarchandel
Valued Contributor II

Re: LOAD a [mapping] table IN ADDITION to already existing table

Hi ,

Use partial reload,

you can use -

TABLE_MAPPING:

Replace load

Col1,

Col2

from source.

see below doc .. will help you .

Partial Reload Easy and Simple

igor_zhilin
New Contributor III

Re: LOAD a [mapping] table IN ADDITION to already existing table

Hi,

Indeed it helps!

1. I added TABLE_MAPPING: REPLACE LOAD... in the script;

2. Then I ran Partial reload;

Now I got TABLE_MAPPING in QV!

Will look into the doc you provided in more detail to see if I can get ApplyMap() to work with the TABLE_ORIGINAL.

Community Browser