SOLVED
Datetime quarter
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
schenkelpat
7 - Meteor
‎10-02-2019
12:40 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I am trying to build a filter that pulls the Quarter to date sales. In SQL, I would have done something like:
Date between Datetrunc('quarter', today()) - interval '1 quarter' and datetrunc('quarter',today())
In Alteryx, I've been able to do DateTimeTrim(DateTimeNow(),'month'); but, i can figure out the date time unit to get to quarter? Is there another way?
Thanks,
Pat
Solved! Go to Solution.
2 REPLIES 2
JordyMicheal
11 - Bolide
‎10-02-2019
12:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Give this a try:
DateTimeFormat([Date],'%Y Q') + ToString(Ceil(ToNumber(DateTimeFormat([Date],'%m'))/3))
‎10-02-2019
12:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Disregard-figured it out...
CEIL(DateTimeMonth([Calendar Date]) / 3) >= CEIL(DateTimeMonth(DateTimeAdd(DateTimeNow(),-1,"month"))/3)
