[My_Value]<-1 AND [My_Value]>1
Put that in a calculated field and place on the filter shelf set to True.
I had this come up before as well and when I created the =T/F it would act out and sometimes not let me drag it on the FIlters shelf. Any idea why?
To work around that (in relation to this thread), I just changed it to be an IF statement and COUNTD so:
IF [Measure] <-1 AND [Measure]>1 THEN COUNTD([Unique ID]) and that worked because I needed a Count and not an aggregate. However, I'd prefer your solution because it would probably be more versatile.
Any idea why it wouldn't let me drag onto the Filters shelf?
Kyle every situation is a bit different, so without seeing why you couldn't drag that calc onto the filter shelf I'd just be guessing. I'm attaching a workbook using Superstore data showing the calc works. If you can post back with a calc like this that doesn't work, I'll take a look and see why it's not working.
Kyle.twbx.zip 1.1 MB
I'm having a hard time recreating it and would have to dumb out the data to share my actual workbook, but I think I can narrow down the why. Also, I've got the solution I want working so if this doesn't make sense no worries.
Couple things right off, I'm using two sources that are exactly identical but from a 30 day difference as a snapshot in time and my =T/F is off the results of another caluclation using both sources. So....
Calculation 1 is ZN(DATEDIFF('day',ATTR([Source1Date]),ATTR(Source2Date])))
' sometimes I get negatives, there are always lots of 0s and there are also nulls where a new record exist in Source2 that was not in source 1 which is why I added the ZN function
Calculation 2 is [Calculation 1] < 1 AND [Calculation 1] = 1
In your twbx this field shows up as a dimension, in mine its in the measures pane and won't let me move it.
Based on all this I'm thinking it has something to do with the multiple data source or running Calculation 2 off another Aggregate or the fact that Calculation 1 uses Attributes.
If you think it can be fixed I'll work on creating a twbx for you, but I'm thinking I will just merge the two sources moving forward so Calculation 1 doesn't have to run off Attributes.
I am fond of the logical NOT operator for things like this, that is, we make a condition that includes everything we don't want, and then put a parenthesis around it and write NOT in front of it to exclude it.
NOT (ColumnName > -1 AND ColumnName < 1)
You'll note that my original calculation was NOT aggregated. Whereas your calculation by definition (coming from a secondary data source) MUST be aggregated. So it's not that you are using a secondary data source it is that your calculation is aggregated. If I had written SUM([Measure])< -1 OR SUM([Measure]) > 1 then Tableau would have automatically created a T/F in the measures window, and would not have allowed me to drag it to the dimensions window. When I created the non-aggregated calc, T automatically put it into the dimensions window, and T won't let me drag it to the measures window. So you're half-right.