You have made a selection of dates withing one month. I need to do selection covering more than one month. Like 15th March to 20th May , so this would be like 15th to 31st march+1st to 30th April"1st to 20th May.
and similar selection for 10years.
Find my updated approach below and stored in attached workbook version 10.2 located in the original thread.
1. day nr: DATEPART('dayofyear', [date])
2. min date: min([date])
3. max date: Max([date])
selection_updated_nalmai.twbx 85.8 KB
Thanks Norbert, this was of big help.
This is good point, however, I don't think in this case it is necessary.
As it is always show last 10 years, so in case it is leap year, 2016 as the latest year, and the end date is 29 Feb 2016, the last 10 years will display 28 ad 29 using the calculation I provided. below is an example.
and if the end date is not 29 Feb 2016, then it won't impact any result as my previous reply.
So my point is no matter whether it is leap year or not, it won't impact the end result. it should always show the expected result.
The first challenge in this approach is that is shows an error in MAKEDATE function. Says undefined function.I am using a live connection to a datasource. i read it in some other post that :
SQL Server has no directly equivalent function, which is why Tableau does not support that function on SQL Server. However, that same functionality can be accomplished with the DATE() function. You just have to build the string. For example:
So can you please help me by either re framing your approach in sync with this or letting me know of any other method.
Thanks that you are putting so much of an effort to solve this. This is unfortunately not working for me.
Please share the workbook if it works for you,
I am happy share the workbook created from Norbert and with my calculation date_modified, but this is just based on your sample data. It can't reflect to your live connection to database.
As you mentioned you connect to the data source live, so I tried the same way to live connect to database from my side by using Date() and come up with the solution above, and it works. If this is not working for you, could you show me what's the error message about?
Thanks Zhouyi..it works perfectly now.
Thanks Norbert also for taking the first lead towards solution.
Now let me take the problem to the other level:
now i want to select period which has starting and end date in different years. Eg.
Star Date End Date Value
Please cover for the Leap year also.
Thanks in anticipation