
2. Re: Need help calculating distinct count by two values, but one needs to not be counted if containing the other value.
Bryan rose Jan 26, 2018 12:33 PM (in response to Satish C)Thanks Satish! It looks like this is producing the correct info, but i am confused exactly HOW this works. I am looking at the calculation and you have:
IF [Count Set] and [Status] = 'Waitlisted' then 'Waitlist' else 'Registered' end
Can you help explain how that works? I am still new to tableau and calculations and i want to make sure I am comprehending all calculations so i can become proficient in writing these myself
Also, why did you include "then 'waitlist'" There is no 'waitlist' status in the data.
Tx

3. Re: Need help calculating distinct count by two values, but one needs to not be counted if containing the other value.
Norbert Maijoor Jan 26, 2018 12:44 PM (in response to Bryan rose)Hi Bryan,
Find my approach as reference below and stored in attached workbook version 10.3 located in the original thread
1. D1. End Status: if ({fixed [Person ID],[Course]:max([Status])})=({fixed [Person ID],[Course]:min([Status])}) then [Status] else "Registered" end
2. M1. Counter: countd([Person ID])
3. Drag the required objects to the indicated locations.
Regards,
Norbert

4. Re: Need help calculating distinct count by two values, but one needs to not be counted if containing the other value.
Satish C Jan 26, 2018 1:14 PM (in response to Bryan rose)Pls go through this https://www.interworks.com/blog/rcurtis/2016/11/21/tableaudeepdivesetscalculatedfields
The calculation means you are finding the person ids with a status distinct count of 1 (thats what the set is doing  pulling all person ids with only a single status into it ) and then equating it to waitlisted.
The then part of an if condition can be anything you write.It creates a new column in the data. It doesnot need to be in the data. Lets say you have a height field and you could write if height>6 feet then 'tall' else 'not tall' tall and not tall do not need to be in the data.
Does this help?