Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

arhadisqlik
New Contributor

Nonconcatenate load followed by Drop table and rename

Hi there 

I have inherited a script from a former colleague and  there are a some code lines I am confused about; they seem redundant to me:

Step 1: He joins two tables:

JOIN(KEYS_tmp)

load distinct * resident ExcelDetails

Step 2: He creates a new table KEYS_tmp2

KEYS_tmp2:

NONCONCATENATE LOAD * resident KEYS_tmp

Step 3: 

DROP table KEYS_tmp

RENAME TABLE KEYS_tmp2 to KEYS_tmp;

Now, why create KEYS_tmp2 in the first place since nothing is done data wise when loading data into it from KEYS_tmp.

I am pretty new to Qlikview and there's probably  a good reason for doing this....

Could anybody in this forum enlighten me?

Thanks in advance 

Best regards 

Anders

 

5 Replies
marcus_malinow
Valued Contributor III

Re: Nonconcatenate load followed by Drop table and rename

Steps 2 and 3 look to be completely redundant

Re: Nonconcatenate load followed by Drop table and rename

Is he doing any operation on "KEYS_tmp" after step 3???
if no then you can avoid step 2 and 3
if yes then yes it is required.

Regards,
Prashant Sangle
Great dreamer's dreams never fulfilled, they are always transcended.
arhadisqlik
New Contributor

Re: Nonconcatenate load followed by Drop table and rename

Hi Prashant - and thank you for the reply 🙂

Yes he joins more tables on the renamed KEYS_tmp.

Why is it not possible to just continue joining to the KEYS_tmp from step1?

Thanks again

Br

Anders

marwen_garwachi
Contributor II

Re: Nonconcatenate load followed by Drop table and rename

 

 

Try to add a fake column to the table KEYS_tmp2

OIN(KEYS_tmp)

load distinct * resident ExcelDetails

Step 2: He creates a new table KEYS_tmp2

KEYS_tmp2:

NONCONCATENATE LOAD * , '1' as Fakecolumn resident KEYS_tmp

Step 3: 

DROP table KEYS_tmp ;

drop field Fakecolumn ;

RENAME TABLE KEYS_tmp2 to KEYS_tmp;

Let us know if that works  😉 

Re: Nonconcatenate load followed by Drop table and rename

I think if there are no transformations happening in step2, then step2 and step3 are redundant and should be removed.