Filter records with date in current quarter
I'm trying to filter for records with a date in the current quarter (e.g. Q1 2023 is Jan 1 - Mar 31 2023). This post shows how to filter for records with a date between two dates. Will I have to calculate the start and end dates of the current quarter? If so, any suggestions on how best to do that please? I basically would need to ascertain the quarter in which the current date falls.
Thanks.
Best Answer
-
Sorry perhaps I wasnt clear. My desired end result is to show all transaction quarter-to-date (QTD, i.e. for the current quarter).
So I first need to determine the current month, to know which quarter I am in. And I need to know the current year because obviously the start/end dates of each quarter change every year.
I have it working now using this approach:
Answers
-
Hi,
I think what you are looking for is filter "transform_timestamp". if you want to calculate quarters easily you can do this like this. The result of the below variable will be a a timestamp from the beggining of march 1
-
Thanks @Pawel Magdanski, but I first need to know which quarter the current date falls in, before doing the above - right? How would I ascertain that?
-
I got it. I can get the current month using the format_timestamp filter on 'now', and go from there.
-
If you are operating with quarters then the begginning and end of every quarter is fixed in terms of date. Unless your apprach is different?
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback