Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Table not found when loading..

I'm trying to load the following and getting "Table not found" error when loading concatenating the second table.. it seems like the second load is completely ignoring the fact that I named the table HCMEMBERSHIP2 and trying to load into HCMEMBERSHIP.. Not sure what i'm missing here.. code is:

HCMEMBERSHIP:

Load

  Peek('System Id',0 ,'HCMEMBERSHIPTEMP') as [System Id],

  Peek('Enrolled Member Count', 0 ,'HCMEMBERSHIPTEMP') as [Enrolled Member Count],

  Date(addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() - 1), 'YYYYMM') AS [Year Month],

  left(Date(addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() - 1), 'YYYYMM'), 4) as Year,

  right(Date(addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() - 1), 'YYYYMM'), 2) as Month

  AUTOGENERATE 1 WHILE addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() + 1) <  Date#($(v_UpdatedDate), 'YYYYMM');   

Concatenate (MEMBERSHIP)

Load * Resident HCMEMBERSHIP;

HCMEMBERSHIP2:

Load

  Peek('System Id',1 ,'HCMEMBERSHIPTEMP') as [System Id],

  Peek('Enrolled Member Count', 1 ,'HCMEMBERSHIPTEMP') as [Enrolled Member Count],

  Date(addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() - 1), 'YYYYMM') AS [Year Month],

  left(Date(addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() - 1), 'YYYYMM'), 4) as Year,

  right(Date(addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() - 1), 'YYYYMM'), 2) as Month

  AUTOGENERATE 1 WHILE addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() + 1) < Date#($(v_UpdatedDate), 'YYYYMM'); 

Concatenate (MEMBERSHIP)

Load * Resident HCMEMBERSHIP2;

1 Solution

Accepted Solutions
jaimeaguilar
Not applicable

Re: Table not found when loading..

Hi,

this is happening because HCMEMBERSHIP and HCMEMBERSHIP2 have exactly the same fields, this causes automatic concatenation. So when you try to do a resident from HCMEMBERSHIP2 you get an error because this table has been automatically concatenated to HCMEMBERSHIP.

try this:

HCMEMBERSHIP:

Load

  Peek('System Id',0 ,'HCMEMBERSHIPTEMP') as [System Id],

  Peek('Enrolled Member Count', 0 ,'HCMEMBERSHIPTEMP') as [Enrolled Member Count],

  Date(addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() - 1), 'YYYYMM') AS [Year Month],

  left(Date(addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() - 1), 'YYYYMM'), 4) as Year,

  right(Date(addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() - 1), 'YYYYMM'), 2) as Month

  AUTOGENERATE 1 WHILE addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() + 1) <  Date#($(v_UpdatedDate), 'YYYYMM');  

Concatenate (MEMBERSHIP)

Load * Resident HCMEMBERSHIP;

Noconcatenate

HCMEMBERSHIP2:

Load

  Peek('System Id',1 ,'HCMEMBERSHIPTEMP') as [System Id],

  Peek('Enrolled Member Count', 1 ,'HCMEMBERSHIPTEMP') as [Enrolled Member Count],

  Date(addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() - 1), 'YYYYMM') AS [Year Month],

  left(Date(addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() - 1), 'YYYYMM'), 4) as Year,

  right(Date(addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() - 1), 'YYYYMM'), 2) as Month

  AUTOGENERATE 1 WHILE addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() + 1) < Date#($(v_UpdatedDate), 'YYYYMM');

Concatenate (MEMBERSHIP)

Load * Resident HCMEMBERSHIP2;


regards

1 Reply
jaimeaguilar
Not applicable

Re: Table not found when loading..

Hi,

this is happening because HCMEMBERSHIP and HCMEMBERSHIP2 have exactly the same fields, this causes automatic concatenation. So when you try to do a resident from HCMEMBERSHIP2 you get an error because this table has been automatically concatenated to HCMEMBERSHIP.

try this:

HCMEMBERSHIP:

Load

  Peek('System Id',0 ,'HCMEMBERSHIPTEMP') as [System Id],

  Peek('Enrolled Member Count', 0 ,'HCMEMBERSHIPTEMP') as [Enrolled Member Count],

  Date(addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() - 1), 'YYYYMM') AS [Year Month],

  left(Date(addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() - 1), 'YYYYMM'), 4) as Year,

  right(Date(addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() - 1), 'YYYYMM'), 2) as Month

  AUTOGENERATE 1 WHILE addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() + 1) <  Date#($(v_UpdatedDate), 'YYYYMM');  

Concatenate (MEMBERSHIP)

Load * Resident HCMEMBERSHIP;

Noconcatenate

HCMEMBERSHIP2:

Load

  Peek('System Id',1 ,'HCMEMBERSHIPTEMP') as [System Id],

  Peek('Enrolled Member Count', 1 ,'HCMEMBERSHIPTEMP') as [Enrolled Member Count],

  Date(addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() - 1), 'YYYYMM') AS [Year Month],

  left(Date(addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() - 1), 'YYYYMM'), 4) as Year,

  right(Date(addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() - 1), 'YYYYMM'), 2) as Month

  AUTOGENERATE 1 WHILE addmonths(Date#($(vDateMin),'YYYYMM'), RowNo() + 1) < Date#($(v_UpdatedDate), 'YYYYMM');

Concatenate (MEMBERSHIP)

Load * Resident HCMEMBERSHIP2;


regards