0
votes

Working in Tableau - My data set looks like this:

Filename   Run    Score
File1      Run1    80
File1      Run2   Null
File1      Run3   Null
File1      Run4    60
File2      Run1    70

I need to be able to filter the file data based on Nulls being in certain runs. My current plan is a calculated field being used as either a parameter or filter (or both):

IF $score_for{$file}{'Run2'} == Null && $score_for{$file}{'Run3'} == Null
THEN $file{'calc value'} = 1 (or 'null values in runs I care about')

Then I can filter all 1's out of the charts and look at the files that did work for runs 2 & 3.

I have a feeling I can do this using INCLUDE, but for the life of me I can't figure out how that works. I've watched their training video three times.

1
It appears that you're looking to identify Null across records (not within the same record). In that case, you will likely need to use a Table Calculationdevlin carnate
@devlincarnate - yes I am trying to identify Null across specific records. That doesn't appear to be an available table calculation. Further, I'd want to be able to use it across several sheets (to either look at nulls, non-nulls, or both)LadyCygnus

1 Answers

0
votes

It looks like your end goal is to identify files that satisfy a condition - in this case, files with non-null values for the runs of interest. This is a good case for using Tableau sets.

There are alot of ways to think of sets: a named filter, a Boolean function defined for each data row, a mathematical set defined for members of some discrete field. I'd recommend something along the lines of:

  1. Define the set of Runs of Interest -- right click on the Run field in the data pane in the left sidebar. Choose Create Set. Call it "Runs of Interest" and manually select the Runs that you want to belong to that set: Run2 and Run3 in your example.
  2. Define the set of Files that Worked -- right click on the Files field, Create a Set. Name it "Working Files", and then instead of manually selecting set members, choose the Use All radio Botton an the TOP of the set dialog, and then choose the Condition tab to define the condition that distinguishes working files from the non-working files.
  3. Enter a condition as a formula such as: MIN(NOT ISNULL([Score])) which will be satisfied for Files where EVERY data row has a non-null score. If instead you want files to belong to the set if ANY data row has a non-null score, then use MAX() instead of MIN().
  4. Now that you have your Working Files set, place it on the filter shelf to restrict the viz to only working files. You can also use sets on the row/col shelves or in calculated fields. You can edit the Runs of Interest set as needed, and the Working File set will adjust