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

Dynamic Totals

tfinn
7 - Meteor

Hi Everybody!

 

I use the following fields in a month-to-date report that is created daily:

Account Number

Count

Amount

Classification

 

The Classification field contains values like ‘Aged’, ‘Material’, ‘Variance Known’, ‘Exception’, and several others. 

 

I group these into three different categories and call the new field Item Classification:

Aged = Aged

Material = Material

Other = everything that is not Aged or not Material

 

I then need to summarize the Count and Amount at the Account Number level based on this new Item Classification field.  I’m doing all this with a combination of Summary, Cross Tab, Dynamic Rename and join tools.

 

tfinn_0-1571936520196.png

 

I also need to create two additional fields called Total Item Count and Total Amount.  I handle this with a formula tool and couple basic formulas:

Total Item Count = ([Aged Item Count]+[Other Item Count]+ [Material Item Count])

Total Net Amount = ([Aged Net Amount]+[Other Net Amount]+[Material Net Amount])

 

This is where I have a problem.  Material Items are not common and sometimes don’t occur for the first several days of the month, so when my formula looks for Material Net Count and Material Net Amount, they don’t always exist and I get an error. 

 

The workflow goes through the original logic fine and just ignores the absence of Material rows, but it crashes when it gets to the hardcoded formula.  What is the best way to total these counts and amounts dynamically?

 

Thanks!

3 REPLIES 3
DiganP
Alteryx Alumni (Retired)

@tfinn You can use the formula tool with a conditional statement and create a 0 for the dates that the Material Items don't exist. 

 

If isnull([ColumnA]) then 0 else [ColumnA] endif

 

I can give you the exact formula if you were to send the workflow with a sample dataset!

Digan
Alteryx
JosephSerpis
17 - Castor
17 - Castor

Hi @tfinn the way I dealt with this where there is a hard coded formula is I use a dummy value to ensure that all columns are present and just filter out the dummy record. I've attached a workflow showcasing this.

tfinn
7 - Meteor

Thank you @JosephSerpis I was able to use a slightly modified version of your solution to resolve my issue. 

Labels