Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
bimanbeginner
Contributor II
Contributor II

Mapping Data

Hi There

I have a data set with two criteria.

1.is system data showing payments from different clients

2.is statement data showing payments from clients

I need to map the data  so that in one line I can find the statement and system data

eg:

System Payment from Client John for 2000 the detail on  the statement is Johnpmnt

with the attached data can I use any function within qlikview to achieve this? Apply Map etc.?

Regards,

8 Replies
sunny_talwar

Would you be able to show what the expected output is?

bimanbeginner
Contributor II
Contributor II
Author

  Hi Sunny

This is basically what I need to see, I know without a unique key to link the two sets this seems quite impossible...Im not sure how else to resolve this though.

   

AmountNameDocNumDetail
2000John212JohnPmnt
2000Peter212PeterPayment
2000Paul212PayMentFrmPaul
2000Ivan212Van02
1000Reggie256Payment1
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

How are you willing to connect the data?

Screenshot_1.jpg

As I understand there are two tables System and Statement.

Both of the tables should be connected by the fields Amount & DocNum & wildmatch between Detail and Name, am I correct?

bimanbeginner
Contributor II
Contributor II
Author

Yes you are correct, The data is recorded in one table split by the account

bimanbeginner
Contributor II
Contributor II
Author

In My actual table there is over 100k records.

Is there maybe a way I could create a mapping table based on the previous records to identify which detail belongs to which name based on common references(detail) used before in the previous records...

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

I am struggling to feature out how have you connected:

Screenshot_1.jpg

In field Detail there are Names that can be linked, but for Ivan and Reggie there are only Amount and DocNum according to what you can connect the data:

Screenshot_2.jpg

qliksus
Specialist II
Specialist II

Based on the sample you provided I have done this code But you may have to test it into your real data

a:
LOAD * INLINE [
    Account,Amount,Detail,DocNum,Dr_Cr,Name
    Statement, 1000, Payment1, 256, Credit,
    Statement, 2000, JohnPmnt, 212, Credit,
    Statement, 2000, PayMentFrmPaul, 212, Credit,
    Statement, 2000, PeterPayment, 212, Credit,
    Statement, 2000, Van02, 212, Credit,
    System, 1000, , 256, Debit, Reggie
    System, 2000, , 212, Debit, Ivan
    System, 2000, , 212, Debit, John
    System, 2000, , 212, Debit, Paul
    System, 2000, , 212, Debit, Peter
];

/******* This is to Make the full outer join to duplicate Each Detail with the corresponding Name ***********/

A1:
load Detail as Detai1l,Detail as Detail2
Resident a ;
Join
load Name as Name1,Name as Name2
Resident a ;

/***************************************************************************************************************/

/******* This is to compare the Detail and Name based on the common Match i.e Comparing the value John with JohnPmnt  likewise the matching string     *********************************************************/


load  *
Where Key<>'1';
load Detai1l as DetailNew,Name1 as Name ,
if( SubStringCount(Detai1l,Name1)  or WildMatch(Name1,'*'&purgechar(Detai1l,'0123456789')&'*')  ,  Name1,1) as Key
Resident A1
Where Detai1l<>'' ;

/************************************************************************************************/

//****************** This to take the not matching string and assuming this as same i.e the Reggie to Payment1 scenario  *********************//

load * ,'' as Key
Where (len(DetailNew)>1 and len(Name)>1  )  ;

load if(  not Exists(DetailNew,Detai1l),Detai1l) as DetailNew,if(  not Exists(Key,Name1),Name1)  as Name
Resident A1

;

//*************************************************************************************//


DROP Table A1 ;

If there are more records like the Reggie then there would be issues

bimanbeginner
Contributor II
Contributor II
Author

Thank You Qliksus , I am in the process of testing this.