Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Unable to filter future months

JinOnn
8 - Asteroid

Im trying to identify items with end of month dates. In this scenario, i want to filter only items on 30th of June and 31st of July.

 

There is 1 line item thats falls under the 31st of July however i tried using the formula shown below but it didn't work. 

 

I am able to get items from before June but not after.

 

Any advise?tempsnip2.pngtempsnip.png

 

 

12 REPLIES 12
JinOnn
8 - Asteroid

Hey Dawn!

 

Thank you for your response! You are right but I need something more dynamic, can't just limit it to June and July forever as this workflow will be used on a monthly basis. Having said that, @KarolinaRoza 's syntax worked! 

 

 

JinOnn
8 - Asteroid

Oh thank you so much @KarolinaRoza !! 

 

You solved it!

 

Question, how does Date time trim work? I don't really get that formula, can you explain?

KarolinaRoza
11 - Bolide

Hi @JinOnn,

 

I copied explanation of this function from Alteryx Help webpage.

I hope it will be useful for you.

I am glad that I could help you .

 

Regards,

Karolina

 

DateTimeTrim

DateTimeTrim(dt,t): Removes unwanted portions of a date-time and returns the modified date-time.

Parameters

dt: Date-time data expressed as a selected column or a specified date-time value between quotes.

t: Trim type. Options include:

  • firstofmonth: Trim to the beginning of the month (this does the same as month).
  • lastofmonth: Extend to one second before the end of the last day of the month.
  • year: Trim to midnight on January 1st.
  • month: Trim to midnight on the first day of the month.
  • day: Trim to the day (i.e., midnight). This converts a date-time to a day with a time of zero (not a date).
  • hour: Trim to the hour.
  • minute: Trim to the minute.

Trimming a date-time does not round the returned value. For example, the time 15:59:59 trimmed to the hour becomes 15:00:00, not 16:00:00.

Example

DateTimeTrim("2016-12-07 16:03:00","year") returns 2016-01-01 00:00:00.

Labels