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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Surya
Creator II
Creator II

Task

Hello., Question: We have two tables Table A and Table B. Table A has unique records and Table B is a transaction table and has redundent data.

 

We have to remove all those records from transaction table B that has status success in Table A but in case of muliple same records we have eliminate only one record from those multiple records.

Table1:

contract NodateStatus
10116/16/2021Success
10126/16/2021Success
10136/16/2021Success
10116/17/2021Insufficient Blanace Type
10126/17/2021Insufficient Blanace Type
10136/18/2021Insufficient Blanace Type

 

Table2:

Table B  
contractdateamount
10116/16/2021100
10116/16/2021100
10126/16/2021100
10116/16/2021100
10116/17/2021200
10126/17/2021100
10136/18/2021300

 

Expected Output:

contractdateamountStatus
10116/16/2021100Success
10116/16/2021100Success
10116/17/2021200Insufficient Blanace Type
10126/17/2021100Insufficient Blanace Type
10136/18/2021300Insufficient Blanace Type

 

Regards,

Surya 

1 Solution

Accepted Solutions
Surya
Creator II
Creator II
Author

T1:
MAPPING LOAD
"contract No" & date AS KEY,
Status
FROM [lib://50_Data/Test/SC4.xlsx]
(ooxml, embedded labels, table is t1);
//*************************************************************************//
Temp:
LOAD
"contract",date,
APPLYMAP('T1',contract&date) AS Status, //Mapping the status field
"contract"&date& APPLYMAP('T1',contract&date) AS KEY,
amount
FROM [lib://50_Data/Test/SC4.xlsx]
(ooxml, embedded labels, table is t2);
//*****************************************************************************
LOAD
*
WHERE SNO <> 1 OR Status <> 'Success' ;
LOAD *,
IF(KEY = PEEK(KEY),PEEK(COUNT)+1,1) AS COUNT
Resident Temp
ORDER BY contract,Status;
DROP TABLE Temp;

View solution in original post

1 Reply
Surya
Creator II
Creator II
Author

T1:
MAPPING LOAD
"contract No" & date AS KEY,
Status
FROM [lib://50_Data/Test/SC4.xlsx]
(ooxml, embedded labels, table is t1);
//*************************************************************************//
Temp:
LOAD
"contract",date,
APPLYMAP('T1',contract&date) AS Status, //Mapping the status field
"contract"&date& APPLYMAP('T1',contract&date) AS KEY,
amount
FROM [lib://50_Data/Test/SC4.xlsx]
(ooxml, embedded labels, table is t2);
//*****************************************************************************
LOAD
*
WHERE SNO <> 1 OR Status <> 'Success' ;
LOAD *,
IF(KEY = PEEK(KEY),PEEK(COUNT)+1,1) AS COUNT
Resident Temp
ORDER BY contract,Status;
DROP TABLE Temp;