Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Blending 2 Spreadsheets

G_SAND
8 - Asteroid

Hi All

I have data from 2 spreadsheets I want to blend. There is common data between the 2 but I can't think of a way of getting the data the way I want it:

Master Spreadsheet:

Part1LevelPart2Field1
a0ax
a bx
a cx
a dx
a ex

 This data is repeated in a similar fashion for multiple parts

Spreadsheet 2

 LevelPart2 Field1
0dy
 d1y1
 d2y2
 d3y3
0ez
 e1z1
 e2z2
 e3z3

Parts d and e are the same as those in the master spreadsheet. I need the header added to SS 2 (which I think is reasonably simple) but then want the data for the parts in SS 2 entered under the parts in the master:

Part1LevelPart2Field1
a0ax
a bx
a cx
a dx
a 0dy
a d1y1
a d2y2
a d3y3
a ex
a0ez
a e1z1
a e2z2
a e3z3

I need to keep both the d and e part numbers from both sheets so they will be doubled up and the 'zeros' in SS2 appear at the start of each of the data sets.

 

Hope that makes sense.

 

Thanks

 

10 REPLIES 10
NickC
Alteryx Alumni (Retired)

Hello,

 

In order to achieve this output you will need to use the Union tool.  Within the Union tool you will have the option to manually configure the fields. An If statement formula will replace the null values for Part1.  

If Isnull([Part1]) then 'a' else [Part1] ENDIF

 

Then a sort on Part 2 Ascending will solve the order.

 

Please see v11.3 workflow attached.

 

 

blend 2 files.jpg

 

 

 

 

 

mborriero
11 - Bolide

@G_SANDhow would you manage the Part1? is it always "a"? or it depends the part2?

If it is always "a" then I agree with @NickC.

G_SAND
8 - Asteroid

Hi. I think I was being a bit too simplistic with my example tables. Here are some more appropriate versions:

 

SS1:

HeaderComponentDescriptionStatusSchedule
1011048762925Steve018
1011087611087Liz12
1011087611103Mike21
1011088176992Glyn3566351
1011087981264Dee4566351
1011087873834Albert3566351
1011087873444Tilly3566351
XXXNEXT SETOF DATA018

 

This is my master spreadsheet. There are hundreds of these sequences all with different headers with Status 0 denoting the start of each one.

 

SS2:

ComponentDescriptionStatusSchedule
1087873834Albert0FRM
1088380666Molly1A
1088463974Izzie1D
1088381887Poppy1D
1088381887Poppy2D
1087873444Tilly0FRM
1088477401Sasha1C
1088556066Mini2A
1088056547Lola1D

 

This is the data I want to add to SS1. Again, the start of each data section starts with Status 0.

 

Albert from SS2 and the data below (up to the next Status 0) needs to slot into SS1 under the Albert that is already there but retaining the info next to it.

Then Tilly from SS2 needs the same thing.

The header needs to be added as well.

 Outcome (hopefully!):

 

HeaderComponentDescriptionStatusSchedule
1011048762925Steve018
1011087611087Liz12
1011087611103Mike21
1011088176992Glyn3566351
1011087981264Dee4566351
1011087873834Albert3566351
1011087873834Albert0FRM
1011088380666Molly1A
1011088463974Izzie1D
1011088381887Poppy1D
1011088381887Poppy2D
1011087873444Tilly3566351
1011087873444Tilly0FRM
1011088477401Sasha1C
1011088556066Mini2A
1011088056547Lola1D

 

I hope this makes it clearer.

 

Thanks

mborriero
11 - Bolide

Hi, I still do not understand how you get header. You say that you have multiple headers. How do you get header 101 for component that are in SS2 but not in SS1?

 

for example

1088056547Lola1D

 

why in your final output has header 101 and not 102?

 

can you please attached an example with more headers?

 

 

G_SAND
8 - Asteroid

Hi, I thought this might be a complicated 1! I'll try again with another example.

Hypothetical:

My company makes CAKE1 and CAKE 2 and here are the ingredients:

 

HeaderComponentDescriptionStatusSchedule
CAKE 11048762925Icing018
CAKE 11087611087Butter12
CAKE 11087611103Flour21
CAKE 11088176992Eggs3566351
CAKE 11087981264Milk4566351
CAKE 21054789416Flour018
CAKE 21074893147Fruit12
CAKE 21039587468Caster Sugar21
CAKE 21015987557Butter3566351
CAKE 21069874501Mixed Nuts4566351

 

The supplier for the Eggs, Milk and Mixed nuts has information about what they need:

 

ComponentDescriptionStatusSchedule
1088176992Eggs0FRM
1088380666Chickens1A
1088463974Feed1D
1087981264Milk0FRM
1088477401Cows1C
1088556066Grass2A
1069874501Mixed Nuts0FRM
1033578917Brazil1C
1044478489Walnut3A

 

They supply these to loads of people so have no idea how it is going to be used so can't have a header. I want a full recipe for my cake so I want the vendors details below the relevant parts in my spreadsheet:

HeaderComponentDescriptionStatusSchedule
CAKE 11048762925Icing018
CAKE 11087611087Butter12
CAKE 11087611103Flour21
CAKE 11088176992Eggs3566351
CAKE 11088176992Eggs0FRM
CAKE 11088380666Chickens1A
CAKE 11088463974Feed1D
CAKE 11087981264Milk4566351
CAKE 11087981264Milk0FRM
CAKE 11088477401Cows1C
CAKE 11088556066Grass2A
CAKE 21054789416Flour018
CAKE 21074893147Fruit12
CAKE 21039587468Caster Sugar21
CAKE 21069874501Mixed Nuts4566351
CAKE 21069874501Mixed Nuts0FRM
CAKE 21033578917Brazil1C
CAKE 21044478489Walnut3A

 

The vendors info is associated with either CAKE1 or CAKE2 so I need those headers somehow added to the relevant rows.

mborriero
11 - Bolide

Try this and let me know if it works. The output it is not in the same order, but it is really close.

 

I hope it is ok, if not I will try to sort it in the correct way but it is quite challenging.

G_SAND
8 - Asteroid

Thanks for your help on this one but unfortunately I does have to match the output.

 

I was just about to start putting the 2 data sheets together manually so I'll carry on with that for now.

 

Don't spend too much time on this if it is too difficult.

 

Thanks again

mborriero
11 - Bolide

Ok, have a try now. It seems to be working but it need to be tested with more data or a different example.

 

I love this challenge :)

G_SAND
8 - Asteroid

Hi.

 

That works or this example so I am confident we can get it going for my actual data.

 

I'll put a selection of it together, as it does get a bit more complicated, and run it through this workflow and see what I get. 

 

Thanks for your help and I'll update the post if I get it to work for my full data set.

Labels