Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator 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
Highlighted
Partner
Partner

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.

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Highlighted
Creator II
Creator II

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

Highlighted
Partner
Partner

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

Plees ekskuse my Swenglish and or Norweglish spelling misstakes