-
1. Re: Tableau Prep - Count Number Days for First Event
Chris McClellanJan 9, 2019 8:20 PM (in response to Greg Barnes)
-
292078.tfl 2.8 KB
-
292078.xlsx 5.9 KB
-
-
2. Re: Tableau Prep - Count Number Days for First Event
Joshua Milligan Jan 10, 2019 8:34 AM (in response to Chris McClellan)Greg,
Here's an alternate approach that is very similar to Chris' but simplifies things a bit. In Chris' example, he joins the aggregate step back to the previous step (in effect, creating an LOD calc). I love that approach! But in this case, I think you can avoid the complexity and simply use an aggregate to find the minimum number of days to the first event for each individual. It assumes that the event date is after the created date (which, even in your data, it is not) - but a simple filter in the Clean step removes any cases where the event date comes first.
Now, if you need any of the detail from the records that is lost from the aggregation, then definitely use Chris' approach to join the aggregate back to the the previous step (that has the details)!
I've attached the packaged flow that is shown here:
Hope that helps!
Joshua
-
292078 (1).tflx 7.9 KB
-
-
3. Re: Tableau Prep - Count Number Days for First Event
Greg Barnes Jan 10, 2019 11:57 AM (in response to Greg Barnes)Hi Chris & Joshua, thank you for both your contributions. The world is a happy place now
I appreciate you taking the time to explain the solutions.
-
4. Re: Tableau Prep - Count Number Days for First Event
Chris McClellanJan 10, 2019 2:37 PM (in response to Greg Barnes)
Now the tough task You can mark ONE response as Correct, you can mark any/all response as being Helpful.
-
5. Re: Tableau Prep - Count Number Days for First Event
Greg Barnes Jan 10, 2019 2:40 PM (in response to Chris McClellan)Both answers work. But I prefer the solution Chris put forward as it fits with where I am going the project.