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.

Sumifs sales based on two dates and a customer type

sugaprat
5 - Atom

I want to do sum sales based on two dates (Date 1 i.e Order date and date 2 i.e Order date - 30 days) and customer ID
PFA the sample excel file where F column ("Last 30 days sum" is the desired result -> formula used: = SUMIFS($D$3:$D$21,$C$3:$C$21,">="&E3,$C$3:$C$21,"<="&C3,$B$3:$B$21,B3)
Try to provide the solution scalable because later I want to do this for last 60, 90, 120 and 150 days. 
Thank you!

1 REPLY 1
gawa
16 - Nebula
16 - Nebula

@sugaprat My approach was to create all of dates in last 30days by the Generate Row tool, and join them with transaction date for each customer. After that, sales value is summed up for each transaction date of customers.

 

Also, in order to specify how many dates to be looked back, I configured Analytic Apps with interface. If you want to dynamically change parameter for analysis, Analytic App should be a good choice. (Also, Analytic App is a way to make it more manageable when deployed on Server so others can execute it with UI.) 

image.png

Labels