Have you tried a combinations of fields? One would be a max date calculation comparison to get the most current date and then comparing taht to your date field. If that condition is met as True then return the value for Stock field. From there, you can create a filter or rule for your "In Stock" value from this resulting field.
You will likely need to use a Window_Max() calculation to get the max date in the view.
If you have a sample workbook to share, I'm sure we can help you out with this.
Another option other than WINDOW_MAX() would be to use LOD calculations with conditional filtering on the Product field. Attached twbx uses the sample data you posted and is made in 10.3, but in case you are on an earlier version here is the screenshot as well.
The [DateParse] field was just something I created since I accidentally pasted the data into Tableau as a string rather than the actual date value. Its formula is "DATEPARSE('yy-MMM-dd', [Date] + '-01')"
Hope that helps out. Thanks!
date filtering.twbx 9.4 KB
Thanks for replying Patrick, Dan's answer seems to have worked for me. appreciate it nonetheless
Dan, that works perfectly, thank you so so so much.
That has really saved me so much time, unreal.
Just a followup on this actually, if I want to make this filter optional so that the user can make the switch how do I do this?
If i add it to the show filter, and toggle between show/hide, it simply removes the stock data.
i've included the workbook here.
Appreciate your help.