1
votes

I want to calculate last 4 any weekdays total sales.Based on filter max date. Example: I have 2 filter 1. Date range(From -To) 2. Week Day(Like Mon,Tue Etc.)

I need total sales for last 4 Monday or Tuesday (as per above filter ).And Last 4 weekdays will be calculated based on To-date in filter. Like To-date is 31-Dec'18 then last 4 Tuesday will be 4,11,18,25 Dec. Thanks in advance for the help.

1

1 Answers

0
votes

Nitika, the best way to do that is creating another table to put a 'Dimension' with dates, int that you can put, weekday, day, holiday, year, month...

Something like that:

Do You Need a Date Dimension?

Why use a Date Dimension Table in a Data Warehouse

Doing that you can reference your atual date with this table, and get just the weekday that you are looking for