
1. Re: Conditional MIN
Jonathan Drummey Apr 22, 2012 4:11 PM (in response to Nicolas Nadeau)Hi Nicolas,
Attached is a sample workbook.
The goal is that we need to calculate the days difference between the date from one row (where action >0) and another row. If we just wanted a datediff between the rows, that's doable using the regular aggregated functions, or if we wanted to return a value for a certain row then we could do that using an aggregated or nonaggregated function. But to do both at once, we need a table calc.
Here's a table calculation that gets the desired # of days:
IF ATTR([action]) > 0 THEN
DATEDIFF('day',LOOKUP(ATTR([date]),FIRST()),ATTR([date]))
END
The calc requires that the userid, date, and action be in the level of detail in the view. The table calc is set with an Advanced... Compute Using on date, userid, and action, sorted on date/Min/Ascending. I created two different views, one is a simple crosstab and the other being histogramtype view with a a Count of how many userids per days.
Jonathan

2. Re: Conditional MIN
Nicolas Nadeau Jul 26, 2012 9:17 AM (in response to Jonathan Drummey)Table calc for the win once again  thanks for this precise answer !