Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Filter to return previous Friday until current day.

Fred22
8 - Asteroid

My data is comprised of tickets from the beginning of time. It is updated each day but we only want to return the previous Friday until the current day. For example: Today is Monday February 12th. When my flow is ran it should only return data from Friday February 9th until now. The date column is in a format of Month Day Year: 2/12/2018.

 

Thank you!

14 REPLIES 14
john_miller9
11 - Bolide

@Fred22

 

This will give you the date of the previous Friday for each date in your file, and then filter to those records since the previous Friday.  This workflow keeps the past 8 days if Today is a Friday.  You can adjust that in the filter though if you expect to only keep Today's records if it is a Friday by lowering to 7.

 

From Previous Friday.PNG

 

Fred22
8 - Asteroid

Hi John,

 

Thank you for the input. This looks like it would work perfectly but I am running Alteryx 10.6 and it won't let me open your file. Anyway you could send the file in a different format or the formulas?

 

Thanks again!

john_miller9
11 - Bolide

Sure - see the workflow and input attached

 

 

Fred22
8 - Asteroid

Hi John,

 

When trying to open alteryx it says there was an error because the document was created by a more recent version of this application and cannot be read.

 

Any suggestions?

john_miller9
11 - Bolide

See the images of my formula and filter tool configurations attached.

 

From Previous Friday - Formula.PNGFrom Previous Friday - Filter.PNG

Fred22
8 - Asteroid

Great thank you! Let me test this and see if it returns what I am looking for.

Fred22
8 - Asteroid

Hi John,

 

I almost have it working. My only issue I am running into is I need to pull everything since last Friday including Friday. With your formula and filter I am getting everything since Saturday Feb 10th. If it can include Feb 9th too it will be solved.

 

Any suggestions? Thank you very much.

john_miller9
11 - Bolide

Ok - try this in the formula tool for Previous Friday

 

 

DateTimeAdd([Date],
	Switch(DateTimeFormat([Date],'%a'),0,
		'Sat',-1,
		'Sun',-2,
		'Mon',-3,
		'Tue',-4,
		'Wed',-5,
		'Thu',-6),
	"days")
Fred22
8 - Asteroid

This has worked. Thank you so much for your continued support!

 

So when next Friday roles around Feb 16th - it will only keep data from that Friday correct?

Labels