Thanks for the sample workbook; it always helps! Couple of things...
First, you are allowing Tableau to misinterpret 'Project State' as a geography. In this case no harm, no foul. Second, if you change the default property of 'Year' from Continuous to Discrete, and then drag it to the filter shelf, you can filter out 2016.
Though I suspect this workbook doesn't actually mirror your 'real' data. If that's the case, post another workbook.
Are you trying to filter only the "Completed" to exclude 2016 or all 3 project states to exclude 2016?
If all 3 states need to exclude 2016, then just pull year on filter pane and exclude 2016.
If you just want to exclude 2016 values for "completed, then create a calculated field called 'Updated # of rows" as the following:
If ([Project State]="Completed" and [Year]<> 2016)
OR ([Project State] <> "Completed" )
then [Number of Records]
Thanks for all the responses. I made one mistake in my sample workbook. The "Year" field is actually a date field. To answer your questions:
- Yes, I am trying to filter out anything that is not 2017 only from "Completed"
- For example, "Completed" would include only this years values and "In Progress" and "On Hold" would not be filtered and would allow for any dates.
Any thoughts on how to update the formula to work with a date field? I can't convert my date field to a number field. Thank you!
The suggested formular above by various members should work without you having to do much type conversion. Did you try those?
1 of 1 people found this helpful
IIF([Project State] = 'Completed' AND YEAR([Year]) == 2016,0,[Number of Records])
Thanks Prayson and Jinesh. I used the calculation below and it works well. I appreciate everyone's help!
If [Project State] = 'Completed' and [Year] < #2017-01-01#
else [Number of Records]