community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

nth Order tool

Highlighted
Asteroid

Hi,

 

Just a quickie - how do i create a field which calculates the nth Order (1st, 2nd, 3rd etc) for a particular customer.

 

I have Customer No, Order Date & Order No. fields in my data.

 

i'm sure it is very easy, but can't find a solution on the forum.

 

Thanks,

 

Richard

ACE Emeritus
ACE Emeritus

Could you select just the Order Date and Order Number; Sort on the Date, then add a RecordID?  The RecordID should then serve as a counter for the orders.  [EDIT: or to reset for each customer... Michael and James' answers have that.]

Asteroid

I could but i want to re-set the nth order each time there is a new customer (to get the nth order for each customer).

 

Thanks

Alteryx Certified Partner
Alteryx Certified Partner

Use the Multi-Row Formula tool to create grouped counts

you'll have to use a multi-row formula tool grouped by customer creating a new field of RecordID

 

Simple formula of :

[Row-1:RecordID]+1
Bolide

Hi rmwillis1973!

 

Do you want just a row per customer with their latest order? If so, Sort by Customer and then Order Date. Then use a Summarize tool to "Group By" on Customer and "Last" on Order#

 

If you want a count of the number of orders they have, you can also add a "Count" on Order# to the Summarize tool!

Labels