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

Make column B 0 for all but 1 value where col A has duplicates

wonka1234
10 - Fireball

Hi,

 

I have the following dataset:

 

WeekHours
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0232
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940
2023_01_0940

 

 

Expected output:

 

WeekHours
2023_01_0232
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_020
2023_01_0940
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090
2023_01_090

 

 

Is there anyway to do this logic without hard coding it?

2 REPLIES 2
Luke_C
17 - Castor
17 - Castor

Hi @wonka1234 

 

You could use a multi-row formula to check for this. This formula is checking to see if the week is different than the preceding row. If it is, it keeps the value, otherwise it sets to 0

Luke_C_0-1686838613339.png

 

 

hlee36
8 - Asteroid

Used unique tool to filter what's unique or not and converted values to 0 for duplicates with formula tool and added these with union tool.

hlee36_0-1686860788566.png

 

Labels