Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Obscure 'Table Not Found' Error

Hi there

I was wondering if you could help me.

I am loading some monthly QVDs in my document and looping through the months to store each in it's own QVD after I have transformed the data.

Find the code

LET vNoOfRecords = NoOfRows('MthsYrs');

FOR i = 0 TO $(vNoOfRecords)

LET vMthName = Peek('MthNme', $(i), 'MthsYrs');

LET vMth = Peek('Mth', $(i), 'MthsYrs');

LET vYr = Peek('Yr', $(i), 'MthsYrs');

SalesTable:

LOAD

//

[BRCODE],

'$(vMthName)' AS MonthName

     ,DECDDT

      ,DMTH

      ,DYR

     ,DMTHNME

      ,[DECDTIME]

      ,[ORDNO]

      ,[LINENO]

      ,[IVNO]

      ,[IVDT]

      ,[CUSTNO]

      ,[CONTACTX]

      ,[PNO]

      ,[ORDQTY]

      ,[OSPAMT]

      ,[SPAMT]

      ,[CPAMT]

      ,[GMCPAMT]

      ,[SURPNO]

      ,[SURSPAMT]

      ,[SURCPAMT]

      ,[CREAID]

      ,[MANPRICEID]

      ,[TERMSTE]

      ,[TERMSCE]

      ,[SAUSERID]

      ,[ORIGDT]

      ,[OORDNO]

      ,[OLINENO]

      ,[OIVNO]

      ,[CORDQTY]

      ,[CUSTORDNO]

      ,[BRNO]

      ,[REASON]

      ,[ORDTYPE]

      ,[SALESMAN001]

      ,[VATTOTAL]

      ,[RBRCODE]

      ,[CUSTOMERTYPE]

RESIDENT SALES WHERE DMTH = '$(vMth)' AND DYR = '$(vYr)';

STORE SalesTable INTO C:\Users\rajesh.bhardwaj\Desktop\MTD Report\QVD\SALES\$(vYr)_$(vMth)_SALES.qvd (qvd);

NEXT i

DROP TABLE SALES;

MaxSalesDate:

LOAD

MIN(DATE(DECDDT)) AS MinSalesDate,

MAX(DATE(DECDDT)) AS MaxSalesDate

RESIDENT SalesTable;

STORE MaxSalesDate INTO C:\Users\rajesh.bhardwaj\Desktop\MTD Report\QVD\SALES\MaxSalesDate.qvd(qvd);

DROP TABLE MaxSalesDate;

When I run this, I get the 'Table Not Found' error. This relates to code from line 7 to line 53 as it is somehow not noticing the table name 'SalesTable' to load and store into a QVD. When I comment the '[CUSTOMERTYPE]' field on line 53 I get no error. I have painstakingly commented and uncommented each line at the SalesTable data load and I get no error, the error only occurs when I bring in the [CUSTOMERTYPE] field. I do not see what I am doing.

Maybe anyone can?

1 Reply
philip_doyne
Partner - Creator II
Partner - Creator II

Is it that you already have a table with all those fields loaded. ( you are loading this as a resident load from a table called sales. That means your first load might be being concatenated automatically (if the fields are the same ).

Try storing Sales as a QVD; then drop table sales; then replace your resident load with a load from the QVD of Sales you have just created.

Philip Doyne

Technical Director, QlickiT Ltd

Mob: 07930 401440

Century Business Centre, Rotherham

South Yorkshire, S63 5DA.