Get full date range of linked field in tableau - tableau-api

Gif of problem
I am currently working on a dashboard in tableau, which shows the count of New-User-Signups and Interactions side-by-side given different date windows. The first New-User-Signup happened before the first Interaction, and the last Interaction happened after the last User Signup.
In order to choose a date window, I linked the date fields in both data sources, and made a date filter, which I applied to all worksheets using related data sources.
However, depending on which "date" field I choose, (from the User Signup table or the Interaction table), the "All Dates" option of the date filter only goes from start to end of that data source's date range.
No matter what I try, I exclude some entries in either one graph or the other. How can I make the "All Dates" filter go from the minimum first date between both data sources, to the maximum last date between the two data sources?

I run into this issue a lot with the data that I use. The problem is that the filter will only be able to contain dates that are in the dataset it is created off of, even if you link the data sources. When I run into this issue, I use parameters instead.
You can find instructions here:
https://kb.tableau.com/articles/howto/creating-a-filter-for-start-and-end-dates-parameters

Related

Have Max value of range of dates filter be todays date

I have a "Range of Dates" filter and what I want is for the max (or right most value) to always be the most recent date which should be today's date. What seems to be happening is that if I leave the dashboard open and come back the next day the max value is yesterday's date and I must manually move the slider over to be today's date. How can I accomplish this?
I find a calculated field is the best way to do this as I have run into the same issues using the out of the box max date filter.
Create a calculated field as follows:
[date] = {FIXED: max([date])}
This creates a True False field where only the records that have the max data and carried through.
Now drag this onto the filter pane and select 'TRUE'.
I've generally seen two basic approaches for this problem: Calculated fields and relative dates.
Use a calculated field or parameter or some combination of calculated fields and parameters with filters. This is similar to what smb suggests in their answer to this question. It also seems to be the most popular approach.
If you don't particularly care about being able to set the end-date with the slider, you could try using relative dates, using the approaches detailed in the accepted answer to this Tableau forum question and in this Tableau Knowledge Base article. Jennifer Vonhagel also gives a second answer to the Tableau forum question farther down that uses a parameter plus calculated field approach.
Additionally, this Tableau Knowledge Base article offers another option (Option 1, in the article) if you have Tableau 10.3+: You can use the "Latest Date Preset" (see here for details) check box in the date filter dialog box. I haven't used this, but it looks promising if you're using Tableau Desktop (seems like it wouldn't work for Tableau Web). The article's Options 2-4 are just riffs on calculated fields, in my opinion.
Two more approaches I've heard of – but never personally seen in the wild:
Push the max date down into the view you put Tableau on top of and let the view do the work.
Use a script to modify the Tableau workbook's XML.

Query on Tableau Dashboard

I am a new to Tableau and having some issues with it.I am Using a parameter to filter month data across Sheets connected to different Data Sources.
I want to Filter Current Month Data Automatically when the dashboard starts.
Can anyone guide me on how to do it.
Thanks in Advance.
T
Introduced in version 10.3 is a feature called Latest date preset. The release notes say "Start with up-to-date data. Set filters to display latest date values automatically, as soon as your workbook opens." Create a filter that spans applies across the data sources and use this new setting. The setting is in the filter dialog.
See https://www.tableau.com/new-features/10.3#tab-analytics-2
The critical aspect of your question is that you are filtering multiple data sources using a parameter. Given that, the most straightforward approach is to define a boolean calculated field in each data source, called say Within_Date_Range.
Each of those calculated fields should compare the appropriate Date field in that data source to the selected parameter value and return true or false to indicate whether the current record should be included in the query. (Parameters are scoped to the workbook and visible from all data sources)
Place the [Within_Date_Range] field for data source X on the filter shelf for the worksheets that use that data source X. Check the true box of course.
Now when you change the parameter, all the worksheets filter accordingly.
Alternatively, you can abandon the use of a parameter. Define relationships between your data sources using the corresponding Date fields (under the data menu). Show a filter control for the date field for one of the worksheets and set the scope to "related data sources"
Hope this helps!
Create a calculated field Date_Filter as
lookup(min([Your_Date_Field]),0)
Drag this to 'Filter'; select 'relative date' option and choose last 1
month (because you wanted to show just the current month data by default).
Right click this filter and select "Apply to selected worksheet" and
choose sheets in which you want this filter to be applied on the
dashboard.Viola!
With this solution you can very well see current month's data by default and can go back to as many time periods you want.

Invalid Date error when entering record on Sharepoint list Datasheet view

I have a list on Sharepoint 2013. I've often use the Edit this list link to make bulk changes to the list in datasheet view with no problem. Last week I had a bunch of new records I needed to add so decided bulk copy and paste from Excel would be best. However, I get the error "Invalid date/time value. A date/time field contains invalid data. Please check the value and try again." The field is Date/Time with Date only display. The format I copied in was mm/dd/yyyy, which is how it's displayed (I realize there's a difference between formatting and display). In the past I've used this format to update dates with no problem. I've tried manually changing the date to other formats like yyyy/mm/dd (or with dashes -), and using the date picker and nothing works. I can add a new item using the form and no problem with the date. It's only happening in datasheet view.
I have 70+ records to add and would rather not have to open a new form for each one (I'm only adding info to 7 of the fields, and I first only pasted a couple records to make sure there were no issues). Are there any recent known issues about date fields in datasheet view? It's a pretty straightforward thing, no calculations are being used, I'm not trying to connect to another service, or use outlying dates (dates are all 2017) so I'm perplexed why this is an issue now and not before. Any thoughts on this would be appreciated.
Found the issue. I had another date field I was not using in that view that for some reason the default value had been set to Calculated field with a value of 1/1/1111. No idea how that got there but I removed that and set the default value to None and now the problem is gone. I found it by creating a new view with every date field in the list and systematically copying a date into each field (in bulk edit) and trying to save after each one until it saved. Then I checked the settings for the field that I was able to save with.

Set the latest date value to the Quick Filter in TABLEAU

There is a live worksheet called Person with columns - Names & Birthdays. Need to create a quick filter with a default value pointing to the latest birthday.
For example: If there are 3 Records as follows,
Names Birthdays
A 8/9/1993
S 6/5/1994
Z 8/15/2000
The filter should hold the default value 8/15/2000 in it with other values unchecked in the drop down list.
I believe I see what you are asking. When you add your filter click the little drop down arrow in the filter --> edit filter-->select the tab labeled "Top"--> by field radio button==>Top from the first drop down-->enter 1 in the next field which will say by after it-->select birthday from the next drop down--then maximum. This will change the view to show only the most recent birthdate. Hope this helps.
Tableau currently doesn't give you dynamic control over quick filter defaults. For dates. They generally start out with the settings that were published.
Here are a few easy suggestions that are similar to, but not exactly, what you want. At the end, there is a way to do exactly what you want at the cost of more effort.
For continuous date fields, you can set the filter to show Relative Dates and the filter allows the user to easily set a range of dates showing the last N days, weeks or months relative to an anchor date. The anchor date defaults to the current date.
For discrete date fields, you can display a top filter as tia97 recommended, and show an integer valued parameter control to allow the user to pick N to see the latest N birthdays. (i.e. the N youngest people)
You could try other variations using parameters, calculated fields and quick filters, but it might be simpler to just show the list of birthdates and let people choose.
Finally, if you are publishing this workbook to Tableau Server, you can use the Javascript API to control the filtering user experience yourself. You can embed the Tableau visualization in a web page, surrounded by custom HTML, CSS and Javascript that you define. Build whatever controls you want for user interaction, and then send JavaScript commands to Tableau to direct the filter actions. More effort, but you get a lot more control over the UX.
Generally, I'd use the builtin features in Tableau Desktop as far as they go to get most of your desired UX quickly and easily, and then save the JavaScript API work for final polish on only your most public visualizations that really need it.

SSRS 2008 limiting scope based on expression

I have a fairly simple problem, but I don't think I understand SSRS and scopes well enough to figure this out.
What I have is a case (one entity) that can have multiple appointments (another entity). Appointments have a date and a status. I want to display the next soonest appointment date and its status. To display the date I'm using
=Min(IIf(Fields!appt_start.Value > Globals!ExecutionTime, Fields!appt_start.Value, Nothing))
The idea is that I first pick only those appointments that occur in the future, and then grab the soonest one. It seems to work great.
Now, I need to apply the same filtering logic, but display the appointment status rather than the date. From my understanding, this is where scopes would come in. I could limit my scope to just the appointment I want, and then show its status. But I don't understand how to do that.
One way to go about this particular problem would be to use a filter in combination with the First function. Add a filter to the table to only show dates greater than the current day. Use a table row with no grouping and use expressions like this:
=First(Fields!appt_start.Value)
=First(Fields!appt_status.Value)
Another option would be to add calculated fields to the dataset to only populate values such as status when the date is greater than the current day. This is useful if you need to show more information later on.
Edit: Yes, you would want to sort the data by date for the First function to work right. You can actually filter at 3 different levels in SSRS. Right-click on your dataset and go to Dataset Properties. Click on Filters. Click Add. Fill in the expression, operator, and value to meet your need. You can also do this in the group properties or the table properties.