Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
cliff_clayman
Contributor II

Resident LOAD not working properly

I am getting an error when I try to run this script:

 

LEFT JOIN (E1P)

E1P_Count:

LOAD [SingleAssignment],[SingleAssignment]&[DollarTest] as ConcatField

Resident E1P;

E1P_Count_SmashedField:
LOAD [SingleAssignment], Count(DISTINCT [ConcatField]) as ConcatFieldCount,
If(Count(DISTINCT [ConcatField]) = 1,'SingleAssignmentFlag',
If(Count(DISTINCT [ConcatField]) > 1,'QtyDiffFlag')) as Flag

Resident E1P_Count
GROUP BY [SingleAssignment];

 

I am trying to add the field, Flag, to my original table, E1P.  The error I am getting is:

 

Table not found error

Table 'E1P_Count' not found

E1P_Count_SmashedField:
LOAD [SingleAssignment], Count(DISTINCT [ConcatField]) as ConcatFieldCount,
If(Count(DISTINCT [ConcatField]) = 1,'SingleAssignmentFlag',
If(Count(DISTINCT [ConcatField]) > 1,'QtyDiffFlag')) as Flag

Resident E1P_Count
GROUP BY [SingleAssignment]

Labels (2)
3 Replies
Partner
Partner

Re: Resident LOAD not working properly

When you do this left join

LEFT JOIN (E1P)

E1P_Count:

LOAD [SingleAssignment],[SingleAssignment]&[DollarTest] as ConcatField

Resident E1P;

You are joining data into the E1P table, you are not creating any table named E1P_Count. 

When you then try to do this... 

E1P_Count_SmashedField:
LOAD [SingleAssignment], Count(DISTINCT [ConcatField]) as ConcatFieldCount,
If(Count(DISTINCT [ConcatField]) = 1,'SingleAssignmentFlag',
If(Count(DISTINCT [ConcatField]) > 1,'QtyDiffFlag')) as Flag

Resident E1P_Count
GROUP BY [SingleAssignment];


...the table E1P_Count does not exist. Try to do an exit script before this part to examine your datamodel.

#OnVacation #BetweenJobs.
Please ekskuse my Norglish and Swenglish typos.
cliff_clayman
Contributor II

Re: Resident LOAD not working properly

How can I add the Flag field to the E1P table?

Partner
Partner

Re: Resident LOAD not working properly

I would have replaced your first load with an preceding load on the E1P-table. Then do the second join on the E1P-table. Like this:

E1P:
LOAD [SingleAssignment],[SingleAssignment]&[DollarTest] as ConcatField
; LOAD Field1, Field2,
SingleAssignment,
DollarTest, ... FieldN FROM E1PSource;
Left JOIN (E1P)
LOAD
[SingleAssignment],
Count(DISTINCT [ConcatField]) as ConcatFieldCount, If(Count(DISTINCT [ConcatField]) = 1,'SingleAssignmentFlag', If(Count(DISTINCT [ConcatField]) > 1,'QtyDiffFlag')) as Flag Resident E1P GROUP BY [SingleAssignment];

I hope this can be of any help. Good luck with finding your solution.

BR Vegar

#OnVacation #BetweenJobs.
Please ekskuse my Norglish and Swenglish typos.