
Not applicable
2012-04-02
11:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Average if (conditional)
Hi,
I have several task in database.
All of them have a begging and end date.
Ex.
task_begin: 12/03/2012 14:30
task_end: 21/03/2012 18:30
task_duration: NetWorkDays(task_begin, task_end)
I want to calculate the average task duration in days.
But due to data quality, I have to remove the values where (duration < 0)
How can I calculate the average without the (duration < 0)?
EX: if(duration > 0;day(avg(Duracao_dias_uteis)))
Regards,
Gonçalo
1 Solution
Accepted Solutions


Partner - Champion III
2012-04-02
11:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Goncalo
Try this:
Avg(if(duration > 0, Duracao_dias_uteis))
Regards
Jonathan
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
1 Reply


Partner - Champion III
2012-04-02
11:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Goncalo
Try this:
Avg(if(duration > 0, Duracao_dias_uteis))
Regards
Jonathan
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
