Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Alteryx is here to help you solve your biggest data challenges. Read about the new Virtual Solution Center here.

Formula to filter all days of current month until specific date

Highlighted
7 - Meteor

Hi all,

 

I am trying to create a formula to do two things: 1- filter out any content that doesnt belong to the current month and 2- exclude any days that come after the last thursday available. For example, if I'm running the workflow on monday 1/20, i need it to exclude any days that come after last thursday (1/6). the first part of the formula (that selects current month) works properly. Here's what I did:

 

Patricia2_0-1580395305481.png

 

What I can't figure out is how to do part 2. Any ideas?

 

Thanks!

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hello @Patricia2,

 

This workflow takes the current month data and then filters out everything after the last thursday:

 

Bad month to choose this one since it ends in thursday!

 

Untitled.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Regards

Highlighted
13 - Pulsar

There's probably a prettier way to do this, but try the following in a Filter tool:

[Dt]> DateTimeAdd(DateTimeFirstOfMonth(),-1,'second')
AND
[Dt]<= DateTimeAdd(DateTimeToday(),-Switch(DateTimeFormat(DateTimeToday(),'%A'),0,
	'Friday',1,
	'Saturday',2,
	'Sunday',3,
	'Monday',4,
	'Tuesday',5,
	'Wednesday',6)
,'day')

The first part does essentially what you already have rolling (just a different approach, both should work), the second part checks what day it is today, then backs it up to the last Thursday and filters based on that. Let me know if you'd like a workflow to get a better idea.

 

Hope it helps!

Dan

7 - Meteor

I tried this one and didn't work. it still includes everything.

Highlighted
7 - Meteor

Thanks! I'll try this out and let you know.

Highlighted
7 - Meteor

I adapted this workflow to incorporate date data from the file but it's not filtering anything. This is what I did:

 

Patricia2_0-1580418150783.png

 

Am I missing something? thanks

Labels