Period Over Period Comparison Bar Chart

@abacon @Naveed
Hi,
I would like to compare this month week wise data with last year same month week wise data. I have a reference graph but having a difficulty to adapt that in Quicksight. Please help me with this.

Attaching an image for reference

1 Like

I’m working on the same and stuck as well and comparing the last 14 days to the same 14 days last year. My solution works, but it’s not great and I’m curious if there is a better, built in way

My solution current is a a series of 2 calculated fields:

Reporting Day Value (example is show the last 3 days) This is used on the X-axis-
ifelse(
dateDiff({reporting_enroll_date},${DailyRun},“DD”) = 365, 14,
dateDiff({reporting_enroll_date},${DailyRun},“DD”) = 0, 14,
dateDiff({reporting_enroll_date},${DailyRun},“DD”) = 366, 13,
dateDiff({reporting_enroll_date},${DailyRun},“DD”) = 1, 13,
dateDiff({reporting_enroll_date},${DailyRun},“DD”) = 367, 12,
dateDiff({reporting_enroll_date},${DailyRun},“DD”) = 2, 12,
0
)

Reference Day (this shows if the data should be included in “this year” or “last year” and is used in the color field well)
ifelse(
dateDiff({reporting_enroll_date},now(),“DD”) <=14, ‘Current’,
dateDiff({reporting_enroll_date},now(),“DD”) >365 and dateDiff({reporting_enroll_date},now(),“DD”) <=379, ‘Last Year’,
‘Not included’
)

1 Like

Hi @carysylvester

Thanks for sharing your solution. But I have only one date column and from that I would like to make this graph. Is it possible to do that?

Hello @Haripriya !

You could use the extract function on the date field you have an set it to weeks.

This will return a numerical value for the weeks so that you can compare the values.

Hello @Haripriya !

I actually changed my thinking on this and I believe this blog post should be able to achieve this for.

1 Like