Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Pulkit_Thukral
Partner - Creator II
Partner - Creator II

Joining 2 tables based on substring values of a field

Hi ,How to left join 2 tables in the below scenario:

Table A

Field Present-Node

Table B

Field Present-Brief Description

I want to have all rows of Table A  and Common rows from Table B(Left Join).

Now,How can the join be made,if Node field values are present as a sub string in Brief Description Column.

Ex:

Table A-

Node

abc

def

Table B-

Brief Description               Time

123abc11231                    10 Nov

31231231def412123          11 Nov

Output:

Table A-

Node     Brief Description             Time

abc         123abc11231                 10 Nov

def          31231231def412123        11 Nov

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

The below Works

243235.JPG

TableA:

LOad * inline [

Node

def

abc

];

mapA

Mapping 

LOAD *,

    '@-'&Node&'-@' 

Resident TableA;

Drop table TableA;

OUTPUT: 

LOAD *, TextBetween(MapSubString('mapA',BriefDescription),'@-','-@')  as Node

inline [

BriefDescription,Time

123abc11231,10 Nov

31231231def412123,11 Nov

];

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

8 Replies
sunny_talwar

Match on text in Brief Description? Meaning everything else will be numbers of could it be like this

123abc11231xyz? and match needs to be on abc only?

vinieme12
Champion III
Champion III

Have you tried figuring out what are the prefix and suffixes?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Pulkit_Thukral
Partner - Creator II
Partner - Creator II
Author

No,not necessarily numbers. Could be anything. just the exact string from Node field has to be present in Brief desc field.

vinieme12
Champion III
Champion III

The below Works

243235.JPG

TableA:

LOad * inline [

Node

def

abc

];

mapA

Mapping 

LOAD *,

    '@-'&Node&'-@' 

Resident TableA;

Drop table TableA;

OUTPUT: 

LOAD *, TextBetween(MapSubString('mapA',BriefDescription),'@-','-@')  as Node

inline [

BriefDescription,Time

123abc11231,10 Nov

31231231def412123,11 Nov

];

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

if your Query is resolved please close the thread

Qlik Community Tip: Marking Replies as Correct or Helpful

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
varshavig12
Specialist
Specialist

MapSubString is something new for me.

Thank you.

Anonymous
Not applicable

///Can USe PurgeChar:

/// purgeChar([Brief Description],'1,2,3,4,5,6,7,8,9,0') as Node,

[Table1]:

load * Inline

[ Node

  abc

  def

  ];

[Table B]:

load

purgeChar([Brief Description],'1,2,3,4,5,6,7,8,9,0') as Node,

[Brief Description],

Time;

LOAD * Inline

[

Brief Description  ,  Time

123abc11231         , 10 Nov

31231231def412123    ,11 Nov

];

drop Table [Table1];

varshavig12
Specialist
Specialist

Hi Apoorva,

We cannot use purgeChar because as mentioned, the brief description can be combination of numbers and characters + Node.

Else this would have been the best option.