Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Identifying last unique row

fordfold
6 - Meteoroid

So I have a table of values each made up of an odd number of rows for an invoice (used mod to filter out evens as don't care about those).

Each set of grouped values has the same invoice date, cost centre and account code and I know the number of rows for each invoice using a count.

 

I just need a way to call out the last row for each invoice, so rows 3 and 8 below? Not sure a multi row formula would work because there could be potentially lots of rows for each invoice.

 

RecordIDvalueRow countInvoice datecost centreaccount code
1-10302/02/2019S300FZ345
210302/02/2019S300FZ345
310302/02/2019S300FZ345
4-20501/01/2019S400AS123
5-20501/01/2019S400AS123
620501/01/2019S400AS123
720501/01/2019S400AS123
820501/01/2019S400AS123

 

4 REPLIES 4
JoshuaGostick
12 - Quasar

HI @fordfold

 

If the RecordID continues all the way through the data, you could use a Sort tool to flip the data so that the highest RecordID is at the top. Then, you could use the Unique tool which will keep the first unique record which in this case will be the last because the data is flipped.

 

Does this make sense, and does this solve your problem?

 

Thanks,

Josh

afv2688
16 - Nebula
16 - Nebula

Hello @fordfold ,

 

You don't need a multi row formula, you can do it easily with the sample tool:

 

Untitled2.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Regards

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @fordfold,

 

(1) Sort by recordid in descending order

(2) Sample top 1, grouping by invoice date, cost centre and account code

(3) Sort by recordid in ascending order

 

image.png 

 

If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.

 

Regards,

Jonathan

fordfold
6 - Meteoroid

Wow thanks for the quick replies guys. I think the second solution with the Sample tool is the simplest but all appear to work. So I have learnt three new techniques!

Have to say this board is a great resource for me, I've been struggling with this for ages but you allowed to get over the hurdle and learn something new at the same time.

Labels
Top Solution Authors