3 Replies Latest reply on Sep 23, 2018 3:51 AM by September Clementin

# Date Compare Custom Season to date in Tableau

I have a scenario to compare the custom season to date comparison

Let's have 2 season in a year (*1-jan-2018 to 31-may-2018) and (*1-june-2018 to 31-dec-2018)

For example

1)

My selected date 13-6-2018

then i should get the values

STD -> Season To Date

Sales[Current_STD] -> sum(sales) from 1-6-2018 to 13-6-2018

Sales[Past_STD] -> sum(sales) from 1-6-2017 to 13-6-2017

2)

My selected date 11-3-2018

then i should get the values

STD -> Season To Date

Sales[Current_STD] -> sum(sales) from 1-1-2018 to 11-3-2018

Sales[Past_STD] -> sum(sales) from 1-1-2017 to 11-3-2017

whats the best approach to get it in single sheet

• ###### 1. Re: Date Compare Custom Season to date in Tableau

So, How would you like to See. If I understand Correctly then you mean to say that , if you select 13-6-2018 from date filter or Parameter, then you should see this

and When you select 11-3-18

then

Let me know if I am missing something,

Thanks

Deepak

• ###### 2. Re: Date Compare Custom Season to date in Tableau

Hi Nandha,

Attached is a workbook that allows a user to choose a Date and select a View (Seasonal or YTD). I've created the following 4 calculations (each evaluates to True or False) based on the date chosen (let's say the user selects Mar, 10, 2017):

Season Current (Jan 1, 2017 - Mar 10, 2017)

Season Prior (Jul 1, 2017 - Sep 10, 2017)

YTD Current (Jan 1, 2017 - Mar 10, 2017)

YTD Prior (Jan 1, 2016 - Mar 10, 2016)

I created another calculation called 'Filter':

If the user selects the 'Season' view then ([Season Current] or [Season Prior])

If the user selects the 'YTD' view then ([YTD Current] or [YTD Prior])

I also created a 'Color By' calculation to make 'current' and 'prior' easy to identify.

I hope this helps,

September

If this post helps to resolve the challenge please mark it 'This helped me' and/or 'Correct Answer'. This will help other users find the same answer/resolution.  Happy dashboarding!

• ###### 3. Re: Date Compare Custom Season to date in Tableau

yes the selection is based on single date parameter.

Deepak Rai