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

Finding the first row of a group with multi-row formula

averyoldakowski
7 - Meteor

Hi, I am trying to create this Beginning Cost column using a multirow formula. I would like to take the Current Value at the beginning of every year and assign it to Beginning Cost, however there could be an unknown number of dates in a year, so just using IF [Row-1:Year] != [Year] THEN [Current Value] would not necessarily work unless you write out each row. Is there a better way to do this? 

 

Ex.

DateCurrent ValueBeginning Cost
01-01-20211000010000
01-01-202280008000
03-01-202265008000
06-01-202260008000
01-01-202360006000
5 REPLIES 5
jordanmount6
8 - Asteroid

You could create a new column for just the Year of the Date column then use the Sample tool for 1st N Row and group by the year column. Then use your multirow tool

averyoldakowski
7 - Meteor

Would that work if I were looking for the first instance of a year within a group?

 

Ex.

UnitDateCurrent ValueBeginning Value
101-01-20211000010000
101-01-202280008000
103-01-202265008000
101-01-202365006500
201-01-20211500015000
205-01-2021700015000
binuacs
21 - Polaris

@averyoldakowski One way of doing this

image.png

averyoldakowski
7 - Meteor

Yes that works! Thank you!

binuacs
21 - Polaris

@averyoldakowski Another method using the multi-row tool, If your Date field is not in Alteryx date format convert that into ISO format (YYYY-MM-DD), then use that field in the multi-row tool for the calculation

image.png

Labels