Create Dynamic Custom Date Calculations including defining quarter as trimester of year

Create Dynamic Custom Date Calculations including defining quarter as trimester of year

1)????Context:

I came across this issue working on the orders data where customer would like to see the orders filtered by last n weeks, last n months etc as well as they would like to see the orders by selecting a start and end date. Currently in Tableau you can only have either last N calculations or start and end date filter. Having both custom date range and last N calculations in the dashboard at user’s discretion makes dashboard flexible to use and get the required insights.

2)????Problem statement:

a.?????Create custom date range parameters: Start date – Last date.

b.?????Create Last N calculations for day, week, month, quarter, year

c.?????Create custom calculations for Quarter defined as a trimester of a year.


3)????Resolution:

a. Here is a snippet of how data looks like,

No alt text provided for this image


b.?????Create a parameter: Range or Last N as shown in the image below

No alt text provided for this image

b.?????Create second parameter: Unit of Time, it will include all the different time periods that you would like to include for the last N calculations.

No alt text provided for this image

c.?????Create third parameter: Range – Start for the user to put the start date.

No alt text provided for this image

d.?????Create fourth parameter:?Range – end for the user to put the start date.

No alt text provided for this image

e.?????Create fifth parameter: Last N

No alt text provided for this image

f.??????Create a calculated field: trimester marker: This is a calculated field to create trimester of a year.

No alt text provided for this image

g.?????Create a calculated field: trimester marker max: Here we are trying to get the max of our date field and crea.( in progress)

No alt text provided for this image

h.?????Create a calculated field: N_Date_filter_new: This will include all the calculations together and it will go in the sheet as filter where value equals to ‘In’. Please refer to the screenshots below,

No alt text provided for this image


In the end, you will be able to filter the data with custom date or last N calculations.

要查看或添加评论,请登录

社区洞察

其他会员也浏览了