forums
Use these forums to ask questions and discuss Tableau.
Dynamically hide missing values
Posted April 10th, 2008 by yannabraham
Hi,
In the course of my work I have to deal with datasets where part of the data is missing (see example).
Since I want to compare several compounds, I would need to remove proteins that are not in the dataset. I can achieve that pretty easily by using a count distinct and a fixed threshold, but I would like to make it dynamic. For example, depending on which 2 compounds are selected, I would see only data for proteins a,b,c, and e (c1 and c2 selected) or a,b,c,d and g (c2 and c3 selected).
Is there a way to achieve that?
Many thanks in advance,
Yann
| Attachment | Size |
|---|---|
| example.twbx | 8.99 KB |
Comments
I am not sure if I totally understood your situation, but I took the example to mean that you would like to dynamically filter out proteins from the results that did not match at least two of the compounds selected.
This may not be as elegant a solution as you would like, but you could create three new calculated fields c1, c2, and c3 to associate each value with a specific compound, like this:
Name:c1
Formula:iif([compound]="c1",[value],Null)
then another calculated field to count the number of compounds that match each protein:
Name:count
Formula:(COUNT([c1])+COUNT([c2])+COUNT([c3]))
then set a filter on the "count" field to exclude records where count is less than 2. I've attached an example.
Dear Aaron,
Thanks for your help, unfortunately it sounds like my example was slightly too simplified.
Actually I am dealing with a dataset of ~100 compounds, where data for new compounds is added on a weekly basis. I therefore cannot afford the solution you suggest, despite the fact it works nicely.
I was more looking along the lines of a single calculated value that would tell me whether of not a line should be included in the final display based on the selected compounds.
Any suggestion is welcome!
Yann