Alteryx Designer Desktop Discussions

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

Multiple column calculation based on secondary input file

je2
5 - Atom

I'm not sure if the title accurately conveys what I want to do, but I have two source files and I need to do a calculation to split out sales by market for each product category. I don't know if I'm going about this the right way, so I was hoping someone could point me in the right direction. 

 

My main data source looks like the following:

CustomerProduct CategorySalesYear
A0011,0002019

 

From this, I have split out the product category by various percentages based on the market the product is sold into. My secondary data source:

Product CategoryMkt 1Mkt 2Mkt 3Mkt 4
00125%25%10%40%

 

I want to calculate the sales based on the percentage splits and have it in the following format so I can pull this into Tableau. 

CustomerProduct CategoryMarketSalesYear
A001Mkt 12502019
A001Mkt 22502019
A001Mkt 31002019
A001Mkt 44002019

 

I'm thinking I could possibly add additional columns and do a calculation for each market type and then transpose the new individual market columns with their split sales into one 'Market' column as shown in the last table, but I'm having trouble. Is this the best method for this?

 

Any help would be appreciated. Thanks! 

 

2 REPLIES 2
Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @je2,

 

I think this workflow solves what you're looking to try and achieve? I'm pivoting your second data source, joining both data sources together and calculating the percentage of sales each record makes up.

 

image.png

 

If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.

 

Regards,

Jonathan

je2
5 - Atom

Thanks, @Jonathan-Sherman! This is exactly what I was trying to do, but wasn't sure how to go about it. 

 

Best,

je2

Labels