Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Function Resident

Hi,

I'm a Qlikview end-user and I have a question regarding the resident function.

I can't use it but I think the program is good.

I need to load this data

Load

WP

Resident YourTable;

Can you help me please?

Thanks

Best regards

7 Replies
suniljain
Master
Master

resident is used if data should be loaded from a previously loaded input table.

Resident table is virtually used the previously loaded table.

it is something like virtual class available in some object oriented programming language.

Not applicable
Author

Yes, I know but how I can use it?

Load

WP

Resident YourTable;

WP is an important data for me

I must load data which exists already in a previously loaded input table.

its_anandrjs

Hi,

Yes, Resident is used on previously loaded tables to load data from previously loaded table

Like in your example

YourTable:

Load

WP,

Col,,,

From Data

Load

*,

WP

Resident YourTable;

Some thing like this

Regards,

Anand

its_anandrjs

Hi,

See the attached sample file

YourData:

load * inline

[

ColA,WP

A,14

B,12

B,10

C,14

C,17

D,16

];

Residenttable:

Load

ColA as NewField1,

WP as NewField2

Resident YourData;

Regards,

Anand

Miguel_Angel_Baeyens

Hi,

RESIDENT always refers to a previously loaded table, so in your script above, "YourTable" must exist prior to the table you are loading. Example:

Customers: // This table already exists, you keep it as it is

LOAD ID,

     Name,

     Address,

     Country,

     RepNo

FROM File.qvd (qvd);

LocalCustomers: // This is the new table you are creating

LOAD ID AS LocalID,

     Name AS LocalName

RESIDENT Customers // load from the table above

WHERE Country = 'ES'; // only local customers

Is that correct?

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

its_anandrjs

Hi,

Yes correct like if you want to load data of ColA='B'

then

YourData:

load * inline

[

ColA,WP

A,14

B,12

B,10

C,14

C,17

D,16

];

Residenttable:

Load

ColA as NewField1,

WP as NewField2

Resident YourData

Where ColA='B';

Regards

Anand

Miguel_Angel_Baeyens

Hi,

Note that according to your script you are loading only one field, that is not being renamed. That means that you are likely not to see that field, because it already exists in a different table. Do as I mentioned below, rename the field, and add some dummy field so you can check the new table you have created.

Regards.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica