Alteryx Designer Desktop Discussions

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

Filter to Remove All Records for a given Location where Each is Zero in Another Field

JerryCooperCMA
5 - Atom

This one is kind of hard to put into words, but the Input and desired Output are shown below. I'd like to apply a Custom Filter (or some other tool?) to evaluate every Account for each Location, and if *all* Amounts (for every Account) are zero, filter out (exclude) every record for that Location. The resulting table would include only those Locations which have a non-zero Amount in at least one Account.

 

JerryCooperCMA_2-1668030606389.png

 

In this case all Tampa records are removed because all Account Amounts are zero, while all 5 records are retained for Lansing because not all Account Amounts are zero. Note that even if only one Account had a non-zero amount, all five (5) records would still be retained for that Location.

 

Thank you for any help you can provide with this.

 

 

 

 

8 REPLIES 8
DavidSkaife
13 - Pulsar

Hi @JerryCooperCMA 

 

Here is one way of doing this - Summerise by Location and sum the amounts, append the sum_amount back to the main data and filter where the sum_amount != 0

 

DavidSkaife_0-1668031847924.png

 

 

Workflow attached!

binuacs
20 - Arcturus

@JerryCooperCMA One way of doing this

binuacs_0-1668032302235.png

 

JerryCooperCMA
5 - Atom

Thank you both for the quick reply! I forgot to include a case like this, where the SUM of amounts could be zero but not all amounts are zero, in which case I would still need to retain the Location:

JerryCooperCMA_0-1668032225709.png

Is there a way to "tweak" that workflow to deal with this situation?

binuacs
20 - Arcturus

@JerryCooperCMA Updated to reflect the new requirement

binuacs_1-1668033058126.png

 

 

binuacs
20 - Arcturus

@JerryCooperCMA Another way of doing this by filtering out the amount with 0 records

 

binuacs_2-1668033237544.png

 

DavidSkaife
13 - Pulsar

Hi @JerryCooperCMA 

 

attached is a tweaked workflow that should work - define the min and max values and filter on either of them not being 0

JerryCooperCMA
5 - Atom

That works! Thank you @DavidSkaife 

JerryCooperCMA
5 - Atom

Thank you @binuacs this works great!

Labels