Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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';

Tags (1)
4 Replies
MVP
MVP

Re: missing data on load

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');

Re: missing data on load

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
Contributor II

Re: missing data on load

Hi Robert,

Use OR instead of AND in Where condition.

Ishan

MVP
MVP

Re: missing data on load

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');