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

Find date where maximum value occurred

smagaldi
5 - Atom

Hi community, 

 

Anyone can help me find the date where maximum sales occurred? And hopefully how long it took for it to happen? 

 

For example: 

 

dateproductrevenue

01/01/2020

1100

01/01/2020

2150

01/03/2020

3120

01/03/2020

2140

01/03/2020

1200

01/10/2020

2150

01/10/2020

1300

01/11/2020

2120

01/15/2020

1130

 

I'm trying to find: 

- Max revenue of 1 - $ 300

- Day of max revenue of 1 - 01/10/2020

- How long it took for the product 1 to have the biggest revenue - 9 days 

 

Having a final output for all the rows, knowing their peak sales and how long it took for each of them to reach their maximum sales in a day. 

 

Any help? 😄 

2 REPLIES 2
Luke_C
17 - Castor
17 - Castor

Hi @smagaldi 

 

Would something like this work? 

 

  1. Convert date to alteryx date format
  2. Sort data by revenue descending 
  3. Sample the first record for each product (representing the max)
  4. Join this to the minimum date for each product (from the summarize tool)
  5. DateTimeDiff formula to get the difference between the date of the max revenue and the first date the product appears.

 

Luke_C_0-1632340595560.png

 

smagaldi
5 - Atom

Hi Luke, 

 

That was super helpful, thanks!

Labels
Top Solution Authors