How to selectively filter based on a dimension? - tableau-api

Link to tableau graph
I want to selectively filter the above graph based on the year. For example, when I deselect December, I want only the 2018 values to be excluded while keeping the December values for the other years.
Tableau version: 2018.3.0

You can create a calculated field called something like "year-month of order date" that contains logic such as YEAR(Order Date) * 100 + MONTH(Order Date). Drag that field to the filter box and include it on the dashboard. Then the user can exclude any combination of year and month combination.

Related

How to display date from a specific month in Excel Pivot Chart

I want my chart showing period from FEB-2020 to DEC-2021. However, if i filter away January, it will remove January for 2020 & 2021. This is because, "Years" & "Date" They are independent filters. How to only filter away JAN-2020 only?
I have figured out.
If create using pivot chart, we can either show month with no data or show month only data. However, show month with no data, u will show full year-month for 2020 which is unwanted.
For pivot chart, u have only 1 way to control month to display is to create dummy data for that month. Then, run a macro to delete "(blank)" legend.
Hit me up, if anyone interested to know more.☺

Tableau: Sliding filter for date, but with a fixed range

I'm trying to create a sliding filter for date in Tableau, but I want the range to be fixed to one day.
For example, the whole filter scale will be from Jan 1, 2020 to December 31, 2020.
I want the viewer to be able to slide along the scale to select a specific date (e.g. June 6, 2020 - June 6, 2020), but not be able to change the size of the range to something longer than one day.
Hope that makes sense. Thanks in advance!
Sticking to filters, do you have already turned your filter data into a discrete filter (blue pill)?
If so, then you should be able to edit your filter and presenting it like a single value / slider.
If you're open to use parameter, you can right-click your date column and select Create-Parameter.
Doing so you should be getting a parameter already filled with all the dates in your column which you can then modify (if you want to get rid of some dates).
Once you show your parameter, it will appear in your worksheet/dashboard and you can edit especially in terms of how it looks like.
In your scenario, you probably want to set it as a slider:
Since the parameter alone won't filter your data, you also need to create a Calculated field with a condition.

How can I set a non-continuous date filter?

I need to be able to filter my data to comparable weeks/months across various years. And I need to be able to update those choices on the fly. Is there a way in tableau to set a non-continuous date filter?
because the base data is saved on the tableau server, I'm unable to join additional tables to it, so my initial idea of making a table of year / start date / end date and joining that to my data with a simple t/f filter isn't panning out.
I've considered making series of parameters, but it seems like it might get a bit overwhelming to make so many
Other things I've considered is writing an extended rule like
IF [year] = 2015 THEN [date]BETWEEN(date A, date B)
or the tableau equivalent to BETWEEN
ELSEIF [year] = 2016 THEN [date]BETWEEN(date C, Date D)
ELSE IF //and so forth
Does anyone else have experience with this? Any strategies you might recommend on the parameters vs. a long formula?
Any ideas are greatly appreciated!
Standard tableau filters on dates allow filtering by both continuous date ranges or filtering by parts of dates.
For example, if you wanted to compare January sales cross multiple years, you can drag your date field to the filters shelf and then right-click the date field in the shelf and choose "Discrete" rather than "Continuous" or choose "Month" in the upper set of options about which date component you want (the upper set selects date components, the lower set selects date ranges with in filters and axes).
So, if you put a date field on the filters shelf and select "month" as a discrete you will get a filter that allows you to filter for every January in the dataset.

Exclude current week in Tableau automatically

I have set of data that is automatically updated each day with new lines.
On the other hand my graphs shows weekly/monthly data.
Is there any way to exclude current week/month, so that the graph can be automatically updated on the server, without me manually excluding and including weeks/months each time I have data for full week/month?
Here's another option which I use regularly in my reports.
Index your date field by week, with a calculated field:
STR(DATEDIFF('week', [Date], today(), 'monday'))
Note that here I have specified my weeks start on Monday, your requirement may be different.
Drag this field onto filters and exclude the value 0, as in the index the current week will always be 0, last week will be 1 etc.
This is an untested example of a calculated field to exclude current week:
IF DATETRUNC('week',[your date field]) = DATETRUNC('week',NOW()) THEN
'filter me'
ELSE
'leave me'
END
Drag that calculated field to filters. In case you couldn't guess, exclude the 'filter me' value :)
make a copy of your date field. Drop on filter, select condition tab, select by formula and drop this in the field:
datetrunc('week',[Order Date (copy)]) <> datetrunc('week',today())

Tableau Line Graph doesn't connect the current month

Hello as you can see in the image,
I have created a worksheet in which I'm trying to show the line graph trend of the number of tickets per month per track level(see filters)
However when i turn on the filter " Show Current Month" to True,
The line graph doesnt connect to the the current month which is Jan 2016
Is this beacuse Jan is a new Year in the graph ?
What can be the solution to the issue ?
Current month issues
Ensure that you are using Continuous date field. http://onlinehelp.tableau.com/current/pro/desktop/en-us/dates_continuous.html
And if your date field is continuous, then you only need one date field on the columns shelf (i.e. get rid of the blue Year([Event Date]) field from the Columns shelf and only keep the green one