modify your script to look as written below
ODBC CONNECT32 TO xxxxxx
SELECT TOP 1000
SELECT TOP 1000
//DROP TABLE TEMPTEST;
//DROP TABLE TEMPTEST2;
DROP FIELDS [mktId], [uniqueNbr];
My previous comment is the most straight-forward solution based on what you provided...however, below will provide some explanation for how to perform the load from temp table approach you originally outlined using qlikview.
You were definitely in the right direction from a logic perspective....just a few areas related to syntax were off.
If you load data in qlikview using the LOAD or SQL Select statements the table resides in the qlikview app memory. To access the table later in the script (for any number of potential reasons), you must use
Here's an example.
// use load statement to create temp table 1 from source qlikview data file (i.e. qvd)
// use sql select statement to create temp table 2 and then
// left join to temp table 1 on TempTable1.field1 = TempTable2.sql_field1 by aliasing the field names to be the same
left join (TempTable1)
sql_field1 as field1,
// use load..resident statement to reload temp table 1 as a new table called Table1
// also alias field name to illustrate simple example of reloading an existing "temp" table
field1 as Field1,
field2 as Field2,
field3 as Field3,
sql_field2 as SQL_Field2,
sql_field3 as SQL_Field3
// remove temp table 1 from qlikview memory as it is no longer needed
drop table TempTable1;
I wanted to provide the solution and then take time to write the explanation....which I added in a reply a minute ago.
Let me know if that doesn't make sense. For whatever reason I can't seem to get the community editor to paste the text with the colors for load script so you may want to copy paste into a qv app for better readability.