Tableau LOD (i think)

223 Views Asked by At

I am trying to create a visualisation where i can see where a product has passed 2 tests: test=overall and test=flash (these are part of the same column). then there is a column result which can be pass/fail. i want both of these tests to be pass and then i want to count the distinct products. I then want to include this figure in a dashboard that updates.

I think I want a LOD but not sure where to start. is this something i do in desktop or prepenter image description here

I am new to Tableau so LOD is something i am trying to get my head around

2

There are 2 best solutions below

4
Abishek VK On

Use the below calculation,

if {fixed [Device]: min([Result])}='fail' then False else TRUE end

Pull this field to filter shelf and select TRUE to get only devices which pass both tests

0
Alex Blakemore On

You didn’t say how to treat devices that have both pass and fail entries for one of your tests. This expression tests whether a device has passed at least one overall test and at least one flash test. You could also use a version of this to define a set if you preferred

{ fixed [Device] : max([test] = “overall” and [Result] = “pass”) and
                   max([test] = “flash” and [Result] = “pass”) }

The key concept is that MIN() and MAX() operate on boolean arguments to return boolean values, treating True values and greater than False values. So MAX() tests whether the condition is ever satisfied; i.e. it returns true if the condition evaluates to true for at least one of the data records. Likewise, MIN() tests whether the condition is always satisfied; i.e. it returns true if the condition evaluates to true for every one of the data records.

If the condition ever evaluates to null, MIN() and MAX() ignore null values just like all other aggregation functions. So if that is an issue in your case, you can use IFNULL() around your expression to provide a default value.