Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Scan the data and map their fields to another Table

Team,

I would like to scan the Comments field to get the the Number along with their data set. I have two table.

Source_Table1:

NumberStatus
041349698A
41350698B
123487978C
124750067D
015599554E
041348923F
041349699F

Source_Table 2:

IDCodeSampleComments
41350554NCMOGHE1) METER OK REPLACED MODULE2) 3) 4) 5) 6)NO#123487978#
41348929YSEIAGH1) CONST.1.34 P.V.102) HANG SET AND TIE IN3) AMI FLEX ID# 240066754) 5) 6)
41348923YWUTS1) CONSTANT=1.342) NO#015599554# / RDG-36172
41349552NCMOGHE1) CONSTANT=1.032) No#041349552# / RDG-
41349698NSNMUT1) SAME NO#041349699# RDG.

I want to scan the Comments column to get the Number and their details (Id,Code,sample). Mapped those details into Source_Table1 based upon the Number column which gets matched.

Example:

1. I'm scanning the comments of "ID=41350554" row to get the Number as "123487978"

2. And compared this number(123487978) to Source_Table1

3. If match row in Source_Table1 , i need to map the (Id=41350554,Code=N,Sample=CMOGHE) to the Number 123487978(In Source_Table1 )


My Final Output will be,

  

NumberStatusCodeSample
123487978CNCMOGHE
15599554EYWUTS
41349699FNSNMUT


Can any one suggest me the output for this.


Thanks,

Shakila

11 Replies
MarcoWedel

Hi,

in case there might be more than one Number in the Comments, you might try with something like this:

QlikCommunity_Thread_278937_Pic1.JPG

QlikCommunity_Thread_278937_Pic2.JPG

Source_Table1:
LOAD Number,
    Status
FROM [https://community.qlik.com/thread/278937] (html, codepage is 1252, embedded labels, table is @1, filters(Remove(Row, Pos(Top, 9))));

Source_Table2:
LOAD ID,
    Code,
    Sample,
    Comments
FROM [https://community.qlik.com/thread/278937] (html, codepage is 1252, embedded labels, table is @2);

mapNumber:
Mapping
LOAD Number, '@start@'&Number&'@end@'
Resident Source_Table1;

tabLink:
LOAD ID,
    TextBetween(CommNum,'@start@','@end@',IterNo()) as Number
While IterNo()<=SubStringCount(CommNum,'@start@');
LOAD ID,
    MapSubString('mapNumber',Comments) as CommNum
Resident Source_Table2;

hope this helps

regards

Marco

qliksus
Specialist II
Specialist II

1) I appended the status field with a string in this case its "Found" so the data will be something like Found&'A'&Found ,  Found&B&Found ,

2)  Mapsubstring will look for the matching substring your are joining with and if a match is found the Status column is returned

3)  The field returned now has the value as  Found&'A'&Found ,  Found&B&Found ............... so just use the

textbetween function to look for your result

Hope this clarifies