Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Does resident keyword create duplicate entries?

I've the following script in Qlikview:

FinalOutput: select emp_id from employees;

Load * resident FinalOutput;

store FinalOutput into FinalOutput1(qvd);

Will the above

Load * resident FinalOutput

statement create duplicate entries in the output file

FinalOutput1?

8 Replies
SunilChauhan
Champion II
Champion II

resident will not create any duplicates value .

you need to drop your base table.

Sunil Chauhan
Not applicable
Author

Thanks Sunil,

How can I get the count of records in FinalOutput1(qvd)?

SunilChauhan
Champion II
Champion II

Load

from qvd

let var=noofrows('Tablename');

now use =$(var) in text box

Sunil Chauhan
Not applicable
Author

Thanks,

Will Load Count(*) from <path>/FinalOutput1(qvd);  work for counting the no. of records?

Will result be the same as with yours?

Not applicable
Author

Qlikview is autoconcatenating your new table into the base table. To prevent it use noconcatenate keyword before load keyword while loading second table.

you can use count() function but in your case best will be just to use  rowno() as rownum in your 2nd table while loading and then you can get count of records in a variable by using

let v_row_count = peek('rownum');

it will stop autoconcatenation also. but remember to drop your base table otherwise you will get synthetic keys.

hope this makes sense.

Regards,

Ashutosh

Not applicable
Author

Thanks Ashutosh,

By new table and base table do you mean FinalOutput1 and FinalOutput resp.?

what is the second table that you are referring to?
Can you plz post the entire script...

Thanks,

Not applicable
Author

second table is the new table which you made using resident.

script can be as

 

t1:

load

     a,

     b

from abc.qvd(qvd);

t2:

load

     a,

     b,

     rowno() as rownum

resident t1;

let v_row_count_t2 = peek('rownum');

drop table t1;

drop field rownum;

Regards,

Ashutosh

SunilChauhan
Champion II
Champion II

yes its work same

but in your count(*) needs to add group by

Sunil Chauhan