Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
kate1
Contributor
Contributor

Join distinctly with non-unique key

Let's say I have the following table parts (of two much larger tables)...

CreditTable:

ProjectContract DateValueLinePosition
3962/17/2154520
3963/15/2178441
3963/15/2178443
...............

 

OrderTable:

Project

Contract DateValueLinePosition
3962/17/2154304
3963/15/2178221
3963/15/2178222
...............

 

I need to match a credit to an order by Project, Contract Date, and Value. I need it to be a one-to-one matching. When I run my current script...

JoinedTable:

LOAD DISTINCT

Project&ContractDate&Value   AS CreditKey

Project&'-'&Line&'-'&Position  AS OrderNumber

RESIDENT OrderTable;

LEFT JOIN LOAD

Project&ContractDate&Value   AS CreditKey

Project&'-'&Line&'-'&Position  AS CreditNumber

RESIDENT CreditTable;

 

I get something like this...

CreditKeyOrderNumberCreditNumber
39602172154396-30-4396-52-0
39603152178396-22-1396-44-1
39603152178396-22-2396-44-1

 

But I WANT this...

CreditKeyOrderNumberCreditNumber
39602172154396-30-4396-52-0
39603152178396-22-1396-44-1
39603152178396-22-2396-44-3

 

Is there a way to do this kind of one-to-one mapping?

0 Replies