3 Replies Latest reply on Nov 13, 2018 11:54 AM by Egor Larin

# Complex scenario: Date Quick Filter Logic (Populate the months of recent year in quick filters )

Hi Community,

I have  a complex scenario and I am using tableau 10.2

I have used LOD to get the maximum process date of the years related to policies in insurance domain.

I need a quick month filter logic referring to processdate using calculated field or any other way where it will populate months  upto January to March because I want to populate the months for 2018(Current year) only as March 5,2018 is the maximum process date of current year. The other months which exceeds the month  of maximum(March of 2018 ) process date of current year should not be populated in quick filters .

I have attached the tableau workbook for your reference. Could you please give me suggestions or logic as it is urgent delivery.

Regards,

Dhritiman

• ###### 1. Re: Complex scenario: Date Quick Filter Logic (Populate the months of recent year in quick filters )

Hey,

I may assume that you will filter out nulls.

• ###### 2. Re: Complex scenario: Date Quick Filter Logic (Populate the months of recent year in quick filters )

Hi Egor,

Your logic is awesome and it solved my issue.

Could you please explain the logic you have implemented.

Can i ask for a favor. I have implemented YOY and attached workbook for Tableau 10.2. Could you please check.

Here, upto March (upto March 2018)is populated in filters. I am calculating YOY for previous years based on January, February and March as selected on filters. Is my logic correct.

• ###### 3. Re: Complex scenario: Date Quick Filter Logic (Populate the months of recent year in quick filters )

Hey,

The logic is that:

1. Get months from all dates in the data
2. Find all months in 2018, it may fall into 2 different scenarios, from your description it is not 100% clear, because the approach will be different. My solution is for 1st scenario. For both I would use LoD
• Current year, so we will use comparison with TODAY() year
• Max year in the data, so we have to find max year in the data regardless of TODAY() year
3. Compare each date months from the 1st step with months from 2nd step (range), and if inside range then return name of month, otherwise it shows null
4. Plus it really matter how looks your visualisation as different dimensions in the view will allow to simplify or add complexity to calcs
5. The logic is achievable with table cacls also, depends on viz itself, especially if you have months in the view

Yeah, seems YoY works correctly in both ways (for a chart with years or years and months). I would test only if you add some extra dimensions like other firmnames, as you might to restart every firmname.

Cheers,

Egor