How to calculate same day last year in quicksight

how to calculate same week last year in quicksight

Hi @kirthikka8 - Welcome to AWS QuickSight community and thanks for posting the question. Can you please provide more details on your question. Are you looking for the week number before 1 year? If you can give some sample example of your expected output, it will help community to help you.

Regards - Sanjeeb

@kirthikka8

See if the periodOverPeriodLastValue works for you.

1 Like

This calculation field not working countIf({Booking_ID}, {samedaylastyear_pacific[Sheet2]}={arr_full_date})
I have current yr and samedaylastyr and count of booking id for all dates in same table wt calculated field should i create to get count of booking id of samedaylastyr
image

this compares jan 1,2018 to jan1,2017. I want to compare jan 2 ,2018 which is sat to the sat of last yr ie jan 1 ,2017 eg


my join looks like this

Hi @kirthikka8, here is a high-level on how to calculate “same week last year”:

  1. Create a Calculated Field for Last Year’s Date:
  • Use dateAdd('YYYY', -1, {your_date_field}) to subtract one year from the current date.
  1. Extract Week Numbers:
  • Extract the week number for the current date: extract('WK', {your_date_field}).
  • Extract the week number for last year’s date: extract('WK', {DateLastYear}).
  1. Create a Custom Filter Condition:
  • Compare the current week number with the week number from the same week last year using a custom filter:
ifelse(
  extract('WK', {your_date_field}) = extract('WK', dateAdd('YYYY', -1, {your_date_field})),
  'Same Week Last Year',
  'Other'
)
  1. Apply the Filter to Your Visuals:
  • Add a visual to your analysis and apply the custom filter condition to focus on the same week last year.

Did this solution work for you? I am marking this reply as, “Solution,” but let us know if this is not resolved. Thanks for posting your questions on the QuickSight Community!

In case you need further assistance with your problem, please create a sample dashboard with sample dataset showing your problem state using Arena and please create a new post, so we can look at it from a fresh perspective. (Details on using Arena can be found here - QuickSight Arena