Hi. I have a chart showing bugs created vs resolved month by month for the past 2 years. My problem is that it appears to be a rolling 2 years - so the first month of the chart day by day is getting reduced results and the most recent month is growing. I can live with the most current data growing - but it just seems wrong to have the oldest data shrink day by day.
Can I just hide the first month?
I have tried using both 2 years and 24 months in the queries, but I always end up with 25 monthly bars.
Hi Chrystal,
You can change the way your queries are doing the date filters. It sounds like the query is currently filtering on "last 2 years" which is a rolling 2 years based on the current timestamp.
This produces the following SQL: WHERE `Issue`.`created_at` BETWEEN (CURRENT_TIMESTAMP - INTERVAL 2 YEAR) AND CURRENT_TIMESTAMP
Instead of doing that, you can filter on "between and including {CURRENT_MONTH.START.SUB(23,'month')} and {TODAY}" which uses relative date variables.
Which is doing this in SQL: WHERE `Issue`.`created_at` >= TIMESTAMP('2022-03-01')
AND `Issue`.`created_at` < (TIMESTAMP('2024-02-27') + INTERVAL 1 DAY)
The latter method will only return the dates from 23 months prior to the first date of the current month, so it is returning 24 bars instead of 25.
Let me know if this works for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.