AVG is a aggregate function used to calculate average of all rows. It also allows you to add a filter condition, where AVG function calculates average of rows selected by filter condition.

Syntax

Note : Only one Aggregation function can be nested inside AVG function.

AVG Function ignores NULL Values while calculating average.

GROUP BY

Informatica groups by ports while calculating average and it is defined by Group By check box in the transformation.

When group by port is not defined, all the rows are grouped and one value is returned.

Example : Without filter condition, Group By Student Name

Return Value :

Rick 85

Shane 90

Syntax

AVG( numeric_value [, filter_condition ] )

Argument | Required | Description |
---|---|---|

numeric_value | Required | Numeric datatype. Passes the values for which you want to calculate an average. You can enter any valid transformation expression. |

filter_condition | Optional | Limits the rows in the search. The filter condition must be a numeric value or evaluate to TRUE, |

Note : Only one Aggregation function can be nested inside AVG function.

AVG Function ignores NULL Values while calculating average.

GROUP BY

Informatica groups by ports while calculating average and it is defined by Group By check box in the transformation.

When group by port is not defined, all the rows are grouped and one value is returned.

Example : Without filter condition, Group By Student Name

Student_Name | Marks |
---|---|

Rick | 90 |

Shane | 85 |

Rick | 80 |

Shane | 95 |

Shane | NULL |

Return Value :

Rick 85

Shane 90