How do you hide the first month in a bar chart?

Chrystal Harris February 27, 2024

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.

25th month.PNG

1 answer

1 accepted

0 votes
Answer accepted
Tracy Chow
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 27, 2024

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.

Screenshot 2024-02-27 at 1.59.28 PM.png

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.

Screenshot 2024-02-27 at 1.57.12 PM.png

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.

Chrystal Harris February 27, 2024

This works! Thank you very much :-)

Like Tracy Chow likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events