cancel
Showing results for 
Search instead for 
Did you mean: 

Filter to return previous Friday until current day.

SOLVED
Fred22
Meteoroid

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!

john_miller9
Asteroid

@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
Meteoroid

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
Asteroid

Sure - see the workflow and input attached

 

 

Highlighted
Fred22
Meteoroid

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
Asteroid

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

 

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

Fred22
Meteoroid

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

Fred22
Meteoroid

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
Asteroid

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
Meteoroid

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?