I would like to create flag for my data based at complete quarter. Something like this logic:
If passed months in quarter less than 3 then flag N else Y
Month - quarter- full quarter flag
10-2022, q4, y
11-2022, q4, y
12-2022, q4, y
01-2023, q1, n
02-2023, q1, n
Any ideas how to do this?
Thanks
Any ideas with window function etc
1条答案
按热度按时间zujrkrfu1#
You can use SQL window function and partition by year of the month and quarter number to get the result you want.
Here is the query: