New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Not applicable

interseccion / intersection

Necesito que me apoyen en el siguiente caso /

I need your support in the following case:

Tabla A

Cod
Nom
1AA
2AB
3AC
5BA
6BB
7BC
8BD

Tabla B

Cod
Dat
2ACV
3BCT
5DGT

Lo que quiero es poder hacer los siguientes filtros

Todo = { 1,2,3,4,5,6,7,8 }

Solo B = { 2,3,5,6 }

Todo lo que esta en A y no en B = { 1,4,7,8 }

What I want is to do the following filters
All = { 1,2,3,4,5,6,7,8 }
Only B = { 2,3,5,6 }
All that is in A and not B = { 1,4,7,8 }

Tags (6)
1 Solution

Accepted Solutions
Not applicable

Re: interseccion / intersection

Hi,

Check with this

TableA:

[Cod,Nom

1,AA

2,AB

3,AC

5,BA

6,BB

7,BC

8,BD];

TableB:

[Cod,Dat

2,ACV

3,BCT

5,DGT

];

Temp:

Load Chr(39) & Concat(Distinct Cod,Chr(39) & ',' & Chr(39)) & Chr(39) as CodA Resident TableA;

Let vCodA = FieldValue('CodA',1);

Drop Table Temp;

Temp:

Load Chr(39) & Concat(Distinct Cod,Chr(39) & ',' & Chr(39)) & Chr(39) as CodB Resident TableB;

Let vCodB = FieldValue('CodB',1);

DROP Table Temp;

FilterTable:

LOAD 'Table A' as Tablename,Cod Resident TableA Where Match(Cod,\$(vCodA));

LOAD 'Only Table A' as Tablename,Cod Resident TableA Where not Match(Cod,\$(vCodB));

LOAD 'Both Table A and Table B' as Tablename,Cod Resident TableA Where Match(Cod,\$(vCodB)) and Match(Cod,\$(vCodA));

Celambarasan

5 Replies
Not applicable

interseccion / intersection

Hi,

use this script .helpful for u

tableb:

Cod, Dat

2,    ACV

3,    BCT

5,    DGT

];

Load *  where Not exists (Cod);

TableA:

Cod, Nom

1,    AA

2 , AB

3,    AC

5    ,BA

6,    BB

7    ,BC

8    ,BD

];

tabA:

Drop table TableA,tableb

Regards

Perumal A

Not applicable

Re: interseccion / intersection

I have to get the information in Table A and Table B, and then to apply the filters, I need cod and name fields

When you select should show all

CodNomDat
1AA-
2ABACV
3ACBCT
7BC-
8BD-

when I select the intersection of Table A and Table B

Cod NomDat
2ABACV
3ACBCT

when I select the data of Table A that are not in the Table B

CodNomDat
1AA-
7BA-
8BD-

Not applicable

Re: interseccion / intersection

Hi,

Little more brief please. how you need to filter?Are you going to use filter(List box) with text as Only Table A,Only Table B,Table A-TableB,All?

Celambarasan

Not applicable

Re: interseccion / intersection

precisely that type of filter is the need, the other I put as an example so you can better understand

Not applicable

Re: interseccion / intersection

Hi,

Check with this

TableA:

[Cod,Nom

1,AA

2,AB

3,AC

5,BA

6,BB

7,BC

8,BD];

TableB:

[Cod,Dat

2,ACV

3,BCT

5,DGT

];

Temp:

Load Chr(39) & Concat(Distinct Cod,Chr(39) & ',' & Chr(39)) & Chr(39) as CodA Resident TableA;

Let vCodA = FieldValue('CodA',1);

Drop Table Temp;

Temp:

Load Chr(39) & Concat(Distinct Cod,Chr(39) & ',' & Chr(39)) & Chr(39) as CodB Resident TableB;

Let vCodB = FieldValue('CodB',1);

DROP Table Temp;

FilterTable:

LOAD 'Table A' as Tablename,Cod Resident TableA Where Match(Cod,\$(vCodA));

LOAD 'Only Table A' as Tablename,Cod Resident TableA Where not Match(Cod,\$(vCodB));

LOAD 'Both Table A and Table B' as Tablename,Cod Resident TableA Where Match(Cod,\$(vCodB)) and Match(Cod,\$(vCodA));

Celambarasan

Community Browser