Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Subtraction from row with multiple variables

Chelseaa
7 - Meteor

Hi all, i need help in subtraction from 2 different rows of data, but i have a few variables:

 

Project - A, B

Duration - 1Y, 2Y

Department - HR, Finance, Mktg

Country - UK, US

 

Input (this is for project A only)

ProjectDurationDepartmentCountryJanFebMarAprMayJunJulAugSepOctNovDec
A2YHRUK101191312141110743
A2YHRUS12148251315129662
A1YHRUK11913101191074314
A1YHRUS1482512148966215
A2YFinanceUK3121431214111091312
A2YFinanceUS513155131512982513
A1YFinanceUK913101191411119107
A1YFinanceUS82512148151214896
A2YMktgUK7433101111109141114
A2YMktgUS662512141298151215
A1YMktgUK119131011111091312
A1YMktgUS14825121412982513

 

Desired output (an additional line to find the delta, in red font)

ProjectDurationDepartmentCountryJanFebMarAprMayJunJulAugSepOctNovDec
A2YHRUK101191312141110743
A2YHRUS12148251315129662
A2YHRUK - US-2-31-1-2-1-1-111-21
A1YHRUK11913101191074314
A1YHRUS1482512148966215
A1YHRUK - US-31-1-2-2-3111-21-1
A2YFinanceUK3121431214111091312
A2YFinanceUS513155131512982513
A2YFinanceUK - US-2-1-1-2-1-1-111-1-2-1
A1YFinanceUK913101191411119107
A1YFinanceUS82512148151214896
A1YFinanceUK - US1-1-2-2-31-1-1-3111
A2YMktgUK7433101111109141114
A2YMktgUS662512141298151215
A2YMktgUK - US1-21-2-2-3-111-1-1-1
A1YMktgUK119131011111091312
A1YMktgUS14825121412982513
A1YMktgUK - US-31-1-2-2-3-111-1-2-1

 

I tried using transpose or multi-row but have no idea how to configure it correctly or i might be using the wrong tools. 

Please help!

 

Thank you in advance!! 🙂

3 REPLIES 3
echuong1
Alteryx Alumni (Retired)

You can pivot your data so your country values are separate columns. After you do the subtraction, you can pivot back.

 

I used a join to get an order column so that I could sort and get the order to UK, US, UK-US.

 

echuong1_0-1605808621273.png

 

PhilipMannering
16 - Nebula
16 - Nebula

I think @echuong1 but since I did it too, please see my version attached.

 

Chelseaa
7 - Meteor

@echuong1 Thank you! it works nicely! 🙂

Labels