Cascading filters on date field on Tableau Desktop

0 votes
I'm attempting to filter my data using a date column that reads "01.10.2020 04:00:00." For example, I should first choose a year's month, then a week of that month (also picked previously), then a day of that week, and so on until hourly accuracy is achieved. My stacked bar should react to the decision (date axis should be more exact) and filter all other data at each choice. We could enlarge the date field (hierarchies), but I'd need this filter to be dynamic. Any assistance would be greatly appreciated. Thank you so much in advance!
Apr 6, 2022 in Tableau by Vaani
• 7,070 points
899 views

1 answer to this question.

0 votes

This may be accomplished using a set of filters generated by custom computations.

To begin, double-check that your field is recognised as a date.

Tableau Date Dimension

If it's showing up as Abc or another kind, you may pick the date and time by clicking on the type itself.

After that, you'll need to perform a series of computations to arrive at your sections of the date. You may get names (such January, February, etc.) from datename('datepart', dateObject) or numeric values from datepart('datepart', dateObject) (1, 2, etc). The datename calculation is recommended since it allows you to utilise dimensions and filtering depending on the hierarchy.

The datepart can take several forms, including year, month, hour, second, and so on. For a comprehensive list, see Date Functions.

Once you've selected all of the portions of the date that you want, right-click on them and choose 'Hierarchy>Create Hierarchy' (you can also do this clicking and dragging dimensions on top of each other). Place the measurements in the proper sequence (by clicking/dragging).

Next, right-click each dimension in your hierarchy and choose Show Filter from the context menu. This will place it on the Filters shelf and make it visible. (Tip: Tableau will add filters to the top of your hierarchy, so start at the bottom so you don't have to reorganise them afterwards.)

Tableau will make the filters hierarchical by default, based on the hierarchy of dimension values created above.

The final formatting may then be fine-tuned by putting them on a dashboard and adjusting the location and appearance of the filters.

Finally, if you have a huge data set, this strategy will be inefficient because Tableau will have to recalculate all hierarchical filter values with every click. I'd recommend using fewer criteria (relative dates or selections) or looking into a guided analytics method.

answered Apr 7, 2022 by Neha
• 9,020 points

Related Questions In Tableau

0 votes
0 answers

How can I sort date field in presence of another date field in Tableau?

Goal: Sort the new ship date in ...READ MORE

Apr 10, 2018 in Tableau by ghost
• 1,790 points
1,353 views
0 votes
1 answer

Is it possible to join tables on the basis of some calculated field in Tableau?

@Ammy999, You can not perform join in the ...READ MORE

answered May 17, 2018 in Tableau by Mathew1810
1,383 views
0 votes
1 answer
0 votes
1 answer

How to get multiple Sets of Measure Names with different Filters on a single sheet in Tableau?

The easiest solution to your query is: 1) ...READ MORE

answered Aug 23, 2018 in Tableau by Naruto
• 710 points
15,302 views
0 votes
1 answer

Tableau: How to create a filter based of 3 different columns?

The case you're using for filters is ...READ MORE

answered Mar 16, 2022 in Tableau by Vaani
• 7,070 points
2,771 views
0 votes
2 answers

How to remove rows with missing values (NAs) in a data frame?

Hi, The below code returns rows without ...READ MORE

answered Aug 20, 2019 in Data Analytics by anonymous
• 33,030 points
14,732 views
0 votes
1 answer

Is it possible to apply filter just to one of the measures

Hey @Ghost, Why don't you use Level of Detail ...READ MORE

answered Apr 17, 2018 in Tableau by Atul
• 10,240 points
1,472 views
0 votes
1 answer

Any filter based on conditional criteria in r?

Consider a data frame like this: #Create DF ...READ MORE

answered May 11, 2018 in Data Analytics by Sahiti
• 6,370 points
2,192 views
0 votes
1 answer

How do I add a custom login and logout page in my Tableau Server on-prem?

I don't believe it is "officially" possible ...READ MORE

answered Mar 4, 2022 in Tableau by Neha
• 9,020 points
729 views
0 votes
1 answer

How to print projects and workbook names based on site id in tableau server client?

Here's how I do it once I've ...READ MORE

answered Mar 9, 2022 in Tableau by Neha
• 9,020 points
1,714 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP