Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
nag78936
Contributor III
Contributor III

why do we use tempfield in script

In table t2 why do we use 

'Temp' as tempfield

Directory;
Orders:
LOAD [Row ID],
[Order ID],
[Order Date],
[Ship Date],
[Ship Mode],
[Customer ID],
Profit
FROM
[..\Downloads\New folder (5)\qlik files\Copy of QS_Sample_Data.xls]
(biff, embedded labels, table is Orders$);
T1:
LOAD *,
rowno() as rownumber resident Orders;
t2:
load *,
'temp' as tempfield
Resident T1
where rownumber >= 1 and rownumber <= 10;
DROP Table Orders,T1;

Labels (1)
1 Reply
vinieme12
Champion III
Champion III

This is to avoid AUTO CONCATENATION

If the currently loading table has the same structure as  previously loaded table ie same number of fields and the same field names Qlik will auto concatenate the currently loading table to the previous table

 

So in this case 'temp' field is being added to avoid auto concatenation as t2 now has 1 extra field qlik won't auto concatenate the two tables

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.