Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

new help in data transformation

anonymous008_G
8 - Asteroid

Hi there,

I am currently doing one automation for my team, and I reach out to very inconsistent data, and I can’t figure out how to transform further as per my business need. Can someone please help me here.

As per the below Input data we have 3 main buckets as Derivatives, Short and Long. Record ID 1 is the total exposure of Derivatives bucket and below that securities of Derivatives bucket till before Short. Record ID 6 has Short bucket which is main bucket and then we have Long bucket in next record that means we do not have any securities in Short bucket. Record ID 7 is Long main bucket and again below that securities which has Long exposure. From Record ID 1 to 5 has total exposure and in Long and Short bucket we will have same securities as Total level segregating between Long and Short depending on the data.

I want to transform this data in such a way that total exposure will stay as it is ie. From RecordID 1 to 5 (before Long or Short word) and Long and Short exposure should populate in column wise in the added columns as per shown below output table. In other words vertical short and horizontal Gross value which us 11 should populate in the newly created Short column and same thing for long.

 

Input data:-

RecordIDSectorGrossNet
1Derivatives19-11
2FX-A31
3FX-B1-1
4FX-C00
5FX-D00
6Short11-11
7Long70
8FX-A31
9FX-B1-1
10FX-C00
11FX-D00

 

Output table:-

RecordIDSectorGrossNetLongShort
1Derivatives19-11711
2FX-A3130
3FX-B1-110
4FX-C0000
5FX-D0000
2 REPLIES 2
LindonB
11 - Bolide

Hi there,

I've attached a workflow that should help. Basically, it involves using a multi-row formula to fill down under 'Derivatives', 'Long' or 'Short'. Then some data transformation to create the Gross/Net columns and the Long/Short columns separately before joining them together. I also added a key filled for each row under each 'Derivatives' in case there are multiple in your actual dataset. Hope this helps and let me know if you have questions or other complications.

 

CPSolution1292610.PNG

anonymous008_G
8 - Asteroid

@LindonB --- thank you so much, this works absolutely fine as needed.

Labels
Top Solution Authors