First and last week of the year

When building cards and having it weekly, my cards always shows a dip at the end/beginning of each year. 

 

This is because week 1 and week 53 are typically shorter.

 

Has anybody came up with a method to combine these accurately? 

 

past year by week.png

 

Best Answer

  • Godiepi
    Godiepi Coach
    Answer ✓

    Try this beastmode and use it as your x-axis

     

    CASE
    WHEN WEEK(`TransactionDate`, 11) = 1
    THEN STR_TO_DATE(CONCAT('12-31-', YEAR(`TransactionDate`) - 1), '%m-%d-%Y')
    ELSE `TransactionDate`
    END

    Domo Arigato!

    **Say 'Thanks' by clicking the thumbs up in the post that helped you.
    **Please mark the post that solves your problem as 'Accepted Solution'

Answers

  • Godiepi
    Godiepi Coach
    Answer ✓

    Try this beastmode and use it as your x-axis

     

    CASE
    WHEN WEEK(`TransactionDate`, 11) = 1
    THEN STR_TO_DATE(CONCAT('12-31-', YEAR(`TransactionDate`) - 1), '%m-%d-%Y')
    ELSE `TransactionDate`
    END

    Domo Arigato!

    **Say 'Thanks' by clicking the thumbs up in the post that helped you.
    **Please mark the post that solves your problem as 'Accepted Solution'
  • @gatormain, did @Godiepi's reply help you out?

  • Do you know if there are any soultions that will not shift the acutal date of the transaction? Trying to leave the cards with the ability to change the by date dimension without skewing the data.

This discussion has been closed.