We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Populating data elements based on transactional code into a single record

Nosal25
8 - Asteroid

We have a transactional system that I am trying to access and pull over some dates.  I would like to populate fields with the date that a specific transaction code occurred.  The challenge is some tranactions happen more than once and I think it would be helpful to capture the date of each of those transactions.  This is an example of the source data:

 

 

Cust_IDTrans_NMTRANS_ENT_CDENT_DT
A1CMET7/1/2016
A2CMFA7/3/2016
A3CMPB7/3/2016
A4CMRS7/23/2016
A5CMRL7/24/2020
A6CMRL7/25/2023
A7CMRL7/26/2028
B1CMET3/25/2016
B2CMNF5/26/2016
B3CMNC5/27/2016
B4CMNF6/15/2016
B5CMNF6/25/2016
B6CMNC6/26/2016
B7CMAB7/12/2016

 

And I would like the output to look like this:

CUST_IDCMET_DTCMNF1_DTCMNF2_DTCMNF3_DTCMFA_DTCMAB_DTCMPB_DTCMRS_DTCMRL1_DTCMRL2_DTCMRL3_DT
A7/1/2016   7/3/2016 7/3/20167/23/20167/24/20207/25/20237/26/2028
B3/25/20165/26/20166/15/20166/25/2016 7/12/2016     

 

 

I seem to have backed myself into a corner where I can populate a field with the date but I have a record for each of the original transaction records.  How do I get just one record for each customer?

 

In case it matters the source I am working with has millions of records. 

 

Thank you.

5 REPLIES 5
patrick_digan
17 - Castor
17 - Castor

@Nosal25 Can you give the attached a try? I'm making use of the crosstab tool to reorient the data. The key is using the multi-row tool grouping by Cust_ID and TRANS_ENT_CD to ensure that the first of each TRANS_ENT_CD lines up.

 

Let me know if that doesn't solve it!

Nosal25
8 - Asteroid

Thank you.  That worked great for the sample data set and really helps me along.  When I ran the actual data through, I got a lot of errors.  Is it possible to reset that count with each customer ID?    

patrick_digan
17 - Castor
17 - Castor

@Nosal25 Can you share the exact error message? Since the count is grouping by customer ID, it seems like that should still work on a big data set...

Nosal25
8 - Asteroid

"Dynamic Rename (49) Could not generate a unique name for field <ABN2_DT>, number 2594, after attempting 999 generated names"

 

???

patrick_digan
17 - Castor
17 - Castor

@Nosal25 Interesting! In that case, I would 1) remove the dynamic rename tool altogether. 2)  Modify the formula tool (if needed) to get column headings that you are comfortable with/need. Currently, I have the formula: 

[TRANS_ENT_CD]+'_'+tostring([NewField])+'_'

I was originally trying to use the dynamic rename tool but you may very well be able to get by without it.

Labels
Top Solution Authors