Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Need solution to solve a problem. Kind of Advanced Xlookup

anandakrishnan
8 - Asteroid

 

Below is Ledger Table: (Input 1)

LDateLCRLDR
01-01-2022100 
02-01-2022650750
03-01-20222001100
05-01-20223001000
07-01-2022400900
09-01-2022100800
11-02-2022 1200
12-02-20223001100
13-02-2022 1000
14-02-2022900400
14-02-2022950850
15-02-20221001200
16-02-2022200 
17-02-20223001000

 

Below is Statement Table (Input 2):-

SDateSDRSCR
05-01-2022100 
06-01-20222001100
07-01-20223001000
07-02-2022400900
08-02-2022100800
15-02-2022 1200
16-02-20223001100
17-02-20228001000
18-02-2022900400
15-03-20221001200
16-03-20222001100
17-03-20223001000

 

DESIRED OUTPUT 1:

LDateLCRSDateSDR
01-01-202210005-01-2022100
02-01-2022650NOT FOUND
03-01-202220006-01-2022200
05-01-202230007-01-2022300
07-01-202240007-02-2022400
09-01-202210008-02-2022100
12-02-202230016-02-2022300
14-02-202290018-02-2022900
14-02-2022950NOT FOUND
15-02-202210015-03-2022100
16-02-202220016-03-2022200
17-02-202230017-03-2022300

 

DESIRED OUTPUT 2:

 

LDateLDRSDateSCR
02-01-2022750NOT FOUND
03-01-2022110006-01-20221100
05-01-2022100007-01-20221000
07-01-202290007-02-2022900
09-01-202280008-02-2022800
11-02-2022120015-02-20221200
12-02-2022110016-02-20221100
13-02-2022100017-02-20221000
14-02-202240018-02-2022400
14-02-2022850NOT FOUND
15-02-2022120015-03-20221200
17-02-2022100017-03-20221000

 

Here I have two Input Tables Ledger and Statement, I want to compare the Ledger table with the statement table to get the ouptut as mentioned above.

OUTPUT1: Compare the Ledger col LCR with Statement Col SDR. Also first match should not come in next row comparison.

OUTPUT2: Compare the Ledger col LDR with Statement Col SCR

 

CAN ANYONE HELP TO SOLVE THE SAME USING ALTERYX. I tried but not getting desired output.

 

 

6 REPLIES 6
geraldo
13 - Pulsar

@anandakrishnan 

 

An example follows.
make the adaptation to excel to see if the result is as expected.

anandakrishnan
8 - Asteroid

@geraldo 

Thanks for turning up for the support.

But its not coming as a desired output. I want to check the Ledger Table with the Statement Table. 

If Ledger LCR values present in the Statement SDR then it should return the SDR value and SDate, also

for ex: if LDR = 100 on 01/03/2023 and if a value (i.e, SDR =100) is present on Statement table on or after 01/03/2023 which comes first should return. ie, if one more LDR of same value (i.e, LDR =100) is present on 05/03/2023 and in statement table of SDR = 100 on 02/03/2023 and SDR = 100 on 08/03/2023, then it should return  SDR= 100 of o8/03/2023.

 

Hope its clear.

FinnCharlton
13 - Pulsar

Hi @anandakrishnan , this will do the job for you:

FinnCharlton_0-1682677130022.png

In the first step, we generate one row for each date between the LDate in the leger, and the maximum SDate in the statement. This allows us to join LDates to all SDates that come after them:

FinnCharlton_1-1682677228340.png

Next, we perform left joins to match LDates and ledger numbers with all SDates in the future with matching statement numbers:

FinnCharlton_2-1682677294121.png

Next, we mark any LDates that didn't join with 'NOT FOUND':

FinnCharlton_3-1682677330017.png

Lastly, we use an iterative macro to correctly assign each ledger / statement combination:

FinnCharlton_4-1682677393657.png

Hope this helps!

geraldo
13 - Pulsar

@anandakrishnan 

 

Check this new version for output 1. I include the input with excel

anandakrishnan
8 - Asteroid

@FinnCharlton 

Thanks for the solution. The matching part is ok, I think the un-match cases ("Not Found Ones) need some updates to0, will again connect with you after trying with multiple cases.

 

anandakrishnan
8 - Asteroid

@geraldo 

Thanks for putting effort and for helping.

But some false result is coming. All matches plus some other matches even if it is not present for ex if a same amount is present in ledger table for every month, but in statement only 11 months have the transaction. The current solution gives as 12 month match. 

Thanks.

Labels
Top Solution Authors