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

Trying to make a column 0 based off of another column that is already 0.

KonaCantTalk
6 - Meteoroid

Hello, 

 

I am new to Alteryx and am struggling with figuring this out. Essentially, I have two columns a [CustomerSpending] column and a [PurchaseMade] column. If one of these columns is 0 then they both should be 0. Unfortunately that is not always the case which is why I am trying to clean this up a little. How can I make each column 0?

 

I thought it would be something as simple as this: 

 

IF [CustomerSpending] > 0
then [PurchaseMade] = 0
ELSE [CustomerSpending]
ENDIF

 

Thank you!

2 REPLIES 2
lmorrell
11 - Bolide

Hi @KonaCantTalk 

 

Workflow is attached

 

Trying to make a column 0 based off of another column that is already 0.png

 

 

Your logic is spot on - however as each formula applies to a single column, we aren't able to overwrite multiple cell values with a single formula. However, by breaking these two formulas up - we can apply the rules to two temp columns with two formulas as below, deselect the originals, and then carry the temp columns forward for further processing. 

 

CustomerSpending_Temp

if [CustomerSpending] = 0 OR [PurchaseMade] = 0 then 0 
else [CustomerSpending]
endif

 

 PurchaseMade_Temp

if [CustomerSpending] = 0 OR [PurchaseMade] = 0 then 0 
else [PurchaseMade]
endif

 

Hope this helps! 

KonaCantTalk
6 - Meteoroid

Hello @lmorrell

 

Wow, this community is incredible. Such a quick and accurate reply, thank you so much!

 

I didn't even think about creating new, temporary, columns. After your explanation that makes sense why we would do that. 

 

Thanks again and have a great evening. 

 

 

Labels