Alteryx Designer Desktop Discussions

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

Formula or Tool similar to an Excel Pivot Table - calculated field/item

Stuart_C
7 - Meteor

Hi,

 

I'm trying to find a function or tool that's similar the calculated field/item in an Excel Pivot Table.  My current data has Actuals and budget in the "Type" column and I'm trying to calculate the variance(budget - actuals) and add this as a row in the "Type" column.  There are 3 different scenarios:

 

1)  There is a budget and actual #'s by department, account name, vendor, and date

2)  There is a budget but no actuals #'s by department, account name, vendor, and date

3)  There is no budget but there are actuals by department, account name, vendor, and date

 

Data

TypeExpense CategoryDepartmentAccount NameVendorDateAmount
ActualsMealsHR605 - LunchMcDonalds1/1/2020        25.00
BudgetMealsHR605 - LunchMcDonalds2/7/2020        30.00
ActualsMealsHR606 - DinnerCarl's JR1/3/2020        75.00
BudgetMealsHR604 - BreakfastWendy's4/5/2020        10.00
ActualsMealsIT606 - DinnerSubway1/4/2020        80.00
BudgetMealsIT604 - BreakfastSubway7/8/2020        13.00
ActualsHotelHR505 - 1 BedroomHyatt2/4/2020     247.00
BudgetHotelHR505 - 1 BedroomHyatt6/8/2020     136.00
ActualsHotelHR506 - 2 BedroomMarriott4/4/2020     245.00
BudgetHotelHR507 - 3 BedroomMotel 53/11/2020     303.00
ActualsHotelIT506 - 2 BedroomRed Rock7/9/2020     265.00
BudgetHotelIT507 - 3 BedroomRed Rock10/11/2020

     457.00

 

Output

TypeExpense CategoryDepartmentAccount NameVendorDateAmount
ActualsMealsHR605 - LunchMcDonalds1/1/2020                                                                 25.00
BudgetMealsHR605 - LunchMcDonalds2/7/2020                                                                 30.00
ActualsMealsHR606 - DinnerCarl's JR1/3/2020                                                                 75.00
BudgetMealsHR604 - BreakfastWendy's4/5/2020                                                                 10.00
ActualsMealsIT606 - DinnerSubway1/4/2020                                                                 80.00
BudgetMealsIT604 - BreakfastSubway7/8/2020                                                                 13.00
ActualsHotelHR505 - 1 BedroomHyatt2/4/2020                                                              247.00
BudgetHotelHR505 - 1 BedroomHyatt6/8/2020                                                              136.00
ActualsHotelHR506 - 2 BedroomMarriott4/4/2020                                                              245.00
BudgetHotelHR507 - 3 BedroomMotel 53/11/2020                                                              303.00
ActualsHotelIT506 - 2 BedroomRed Rock7/9/2020                                                              265.00
BudgetHotelIT507 - 3 BedroomRed Rock10/11/2020                                                              457.00
VarianceMealsHR605 - LunchMcDonalds2020                                                                   5.00
VarianceMealsHR606 - DinnerCarl's JR2020                                                              (75.00)
VarianceMealsHR604 - BreakfastWendy's2020                                                                 10.00
VarianceMealsIT606 - DinnerSubway2020                                                              (80.00)
VarianceMealsIT604 - BreakfastSubway2020                                                                 13.00
VarianceHotelHR505 - 1 BedroomHyatt2020                                                            (111.00)
VarianceHotelHR506 - 2 BedroomMarriott2020                                                            (245.00)
VarianceHotelHR507 - 3 BedroomMotel 52020                                                              303.00
VarianceHotelIT506 - 2 BedroomRed Rock2020                                                            (265.00)
VarianceHotelIT507 - 3 BedroomRed Rock2020                                                              457.00

 

Thank you,

 

- Stuart

4 REPLIES 4
echuong1
Alteryx Alumni (Retired)

You can take advantage of the cross-tab and transpose tools to "pivot" your data for the calculations.

 

See attached for an example.

 

echuong1_0-1597083940645.png

 

Stuart_C
7 - Meteor

Thank you @echuong1 !  I'm receiving [Null] values in some cells in the Actuals and Budget column so it's calculating a [Null] for the variance.  Could you please help me correct this?

echuong1
Alteryx Alumni (Retired)

Are you able to upload a copy of the data you're using?

 

The data cleansing tool should take care of any nulls, and I don't see any on my side. 

Stuart_C
7 - Meteor

I figured it out.  I forgot to check the Actuals and Budget fields in the Data Cleansing tool.  Everything works perfectly!  Thank you!

Labels