Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

missing data on load

Trying to limit data pull with where statement

it works with just this Where FGName = 'Bria Management'

But when I add the AND nothing comes over or it errors out

[FacGroupDefs]:
LIB CONNECT TO [pharmoresql production (pharmore_rwinkel)];
LOAD FGID,
  FGName;

SQL SELECT  FGID,
  FGName
FROM "Fac"."dbo"."FacGroupDefs"

Where FGName = 'Bria Management'
AND FGName = 'Carr'
AND FGName = 'DAAS Management';

4 Replies
swuehl
MVP
MVP

A single input record can't show different values in a field at once. I think you are looking for an OR logic;

Where FGName = 'Bria Management'

OR FGName = 'Carr'

OR FGName = 'DAAS Management';



edit:

Alternatively, you can use Match():

...

WHERE Match(FGName, 'Bria Management','Carr','DAAS Management');

sunny_talwar

Just to clarify the OP, the Where Match statement will go in the preceding load statement rather than the SQL Select statement

[FacGroupDefs]:
LIB CONNECT TO [pharmoresql production (pharmore_rwinkel)];
LOAD FGID,
  FGName

WHERE Match(FGName, 'Bria Management','Carr','DAAS Management');
SQL SELECT  FGID,
  FGName
FROM "Fac"."dbo"."FacGroupDefs";

But this would require to bring in unnecessary data through SQL which you will remove in the preceding load. So, I think it would be better to restrict in your SQL statement using OR method that Stefan has pointed out or use another similar approach.

ishanbhatt
Creator II
Creator II

Hi Robert,

Use OR instead of AND in Where condition.

Ishan

swuehl
MVP
MVP

Right, I've overlooked the SQL statement.

You can use the IN operator in SQL to do the same:

...

WHERE FGName IN ('Bria Management','Carr','DAAS Management');