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

How to zero out subsequent cells in a field so data is not duplicated

MrJWoo
6 - Meteoroid

I am merging data from my invoice register that is at a sales order level with data from a costing module that can have multiple rows of data (sales order followed by 4 digit job suffix). The problem I am having is that while I do want multiple rows of data, I do not want the field Invoice Amount to be populated on every row. The invoice amount should only show up once for a sales order, and all subsequent rows until the next sales order for the invoice amount should be zero. Below is an example of the data I currently have, and then what I would like it to look like afterwards. 

Before

MrJWoo_0-1682480224153.png

After

MrJWoo_1-1682480296975.png

 

2 REPLIES 2
ShankerV
17 - Castor

Hi @MrJWoo 

 

One way of doing this.

 

ShankerV_0-1682481424252.png

 

IF [Order Number]=[Row-1:Order Number]
THEN 0
ELSE [Invoice amount]
ENDIF

 

ShankerV_1-1682481481762.png

 

 

Input was:

 

ShankerV_2-1682481505815.png

 

 

Note: Cant duplicate the entire dataset as it was pasted as screenshot, but the same replica will work in your huge dataset too.

 

Many thanks

Shanker V

MrJWoo
6 - Meteoroid

Thank you ShankerV, that did the trick! I was thinking of a similar way to do it in Excel but wasn't sure how to translate that into the IF statement in the formula tool. Appreciate the help!

 

Labels