Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
nisha_rai
Creator II
Creator II

Intersection between two values

Hi,

I want those data set which is common between two values.Please help me to resolve the issue.

for example;

filed1 Contain A and B value

Filed2  contain C, D,E,F,G,H,I,J etc

C,D,E is common value for A and B

I want to create a Table which is giving me the common value of  filed1

Expected Reult:

Filed1 Field2

A         C

B

A       D

B

A       E

B

Thanks

7 Replies
sushil353
Master II
Master II

Hi,

What is the expected output?

Anil_Babu_Samineni

Where Exists() can help you

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
PrashantSangle

Hi,

Can you provide proper data with required output in excel..

Regards,

Prashant

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
nisha_rai
Creator II
Creator II
Author

Hi,

Field1 Field2

A   C

A  D

A  E

A  F

A  G

B   C

B   D

B   E

B   I

B   J

Expected Output

Field1 Filed2

A   C

B   C

A   D

B  D

A  E

B  E

A  F

A  G

ahaahaaha
Partner - Master
Partner - Master

Hi Nisha,

May be like this

Table1:

LOAD*Inline

[Field1, Field2

A, C

A, D

A, E

A, F

A, G

B, C

B, D

B, E

B, I

B, J];

NoConcatenate

Table2:

LOAD*

Resident Table1

Where Field1 = 'A' Or (Field1 = 'B' And Previous(Field1) = 'A' And Field2 = Previous(Field2))

Order By Field2, Field1;

DROP Table Table1;

Result

1.jpg

Regards,

Andrey

sasiparupudi1
Master III
Master III

May be Try

T1:

Load

    *,

    AutoNumber(Field2) as Key;

Load * Inline

[

Field1,Field2

A,C

A,D

A,E

A,F

A,G

B, C

B, D

B, E

B, I

B, J

];

T2:

NoConcatenate Load

    Field1,Field2,Key,

     If(Key=Peek(Key),1,0) as Flag

Resident T1

Order by Key;

Inner Join(T2)

Load

Distinct Key

Resident T2

Where Flag=1;

Drop Table T1;

nisha_rai
Creator II
Creator II
Author

Thanks Andrey,

Based on the result i want to apply section access on that.

For example:

User X belong to A, can able to see the all the data of Field 2 which belong to A but for B he can able to see only the common data. means

User X  can able to see the below data

Field1 Field2

A   C

A  D

A  E

A  F

A  G

B   C

B   D

B   E

Regards,

Nisha