Hi is there a function such that:
Let's say the table is as such below:
Date Contract Year Quarter Sales
2016-05-01 2016 Q2 1000.00
...
2016-12-30 2016 Q4 2502.00
2016-12-31 2016 Q4 2000.00
I want the function to say return the contract quarter given a certain date, i.e. if input is 2016-12-30 I want the function to return "2016 Q4" so that I can apply this in a filter to filter sales only for the quarter.
Ultimately what I want to achieve is a "sum to date" for sales starting from the starting date for the quarter.
Sounds like you're looking for a parameterised filter...
Sounds to me like you want a calendar table building in your database...