We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Bring data from previous 2 weeks excluding weekends

grromerro
8 - Asteroid

Hi Community,

 

I need your help here! 

 

I have a workflow that brings data from previous week (only working days Monday to Friday) and calculates average pricing for those two weeks. Now, I need to bring data from previous 2 weeks excluding weekends and calculate the average pricing as well. 

 

I worked around and got the results I wanted but following so many steps that I am afraid that in a giving time, that would have an error. I really would like to simplify the long list of steps and need your help getting the results in a more efficient way. 

 

I have attached the workflow. Thank you in advance GR. 

Prior 2 weeks case.JPG

3 REPLIES 3
griffinwelsh
12 - Quasar

Simpler is sort of subjective but this solution gets rid of the huge stack in the formula tool. It has more tools but should be easier to follow.

2006.png

KGT
13 - Pulsar

You can also use this formula in the filter tool. You can alter it by replacing DateTimeToday() with a pre-calculated field that designated the end of the period.

 

[Date] >= DateTimeAdd(Left(DateTimeToday(),10),-14,'day') &&
DateTimeFormat([Date],"%a") NOT IN ("Sat","Sun")
// This is an alternative to the second line above: ToNumber(DateTimeFormat([Date],"%w")) <= 5

grromerro
8 - Asteroid

Thank you so much for your help

 

Labels
Top Solution Authors