Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Logical AND in Value-Selection on Dashboard

Hi QlikView-Community,

I have a , hopefully, simple question. Just for testing reasons, I have threee small data sources. All data sources include the names of a given set of clients. In addition, every data source represents one single system, where the clients are listed in.

Example:

DataSource 1:

ClientDataSource
Client 1A
Client 2A
Client 3A

DataSource 2:

Client Data Source
Client 1B
Client 3B
Client 4B

DataSource 3:

Client Data Source
Client 4C
Client 5C

What I would like to know is, which of the clients is listed, for example, ONLY in DataSource A AND Data Source B (and NOT in Data Source C). In this example the result would be Client1 and Client 3.

When adding the fields in QlikView and selecting  Data Source A and Data Source B the result is Client 1, 2,3, 4 as QlikView works with a Logical OR - so it lists all clients that are in Data Source A or in Data Source B

How can this be avoided?

Thanks in advance,

Philip


4 Replies
rajeshvaswani77
Specialist III
Specialist III

At a very high level, you could use inner join, exists.

thanks,

Rajesh Vaswani

trappersw
Partner - Creator
Partner - Creator

Hello Philip,

I forced a solution in attatchement, but I suspect you want it more flexible. If so, please elaborate on your problem.

Regards,

Wouter

temp_List:

LOAD Client,

     [Data Source],

     1 as [Data Source Number]

FROM

DataSource1.xls

(biff, embedded labels, table is [Sheet1$]);

temp1_List:

concatenate LOAD Client,

     [Data Source],

     2 as [Data Source Number]

FROM

DataSource2.xls

(biff, embedded labels, table is [Sheet1$]);

temp2_List:

concatenate LOAD Client, 

     [Data Source],

     3 as [Data Source Number]

FROM

DataSource3.xls

(biff, embedded labels, table is [Sheet1$]);

temp3_List:

load

  Client,

  if(count([Data Source])=2,1,0) as Counter

resident temp_List

where [Data Source Number] =  1 or [Data Source Number] = 2

group by Client;

drop table temp_List;

List:

load

  Client

resident temp3_List

where Counter = 1;

drop table temp3_List;

Gysbert_Wassenaar

See attached qvw


talk is cheap, supply exceeds demand
trappersw
Partner - Creator
Partner - Creator

Much more elegant indeed