public static class RolapAggregator.AvgFromSum extends RolapAggregator.BaseAggor
It uses the aggregate table fact_count column and a sum measure to create the query used to generate an average:
avg == sum(column_sum) / sum(factcount).
If the fact table has both a sum and average over the same column and the aggregate table only has a sum and fact count column, then the average aggregator can be generated using this aggregator.
RolapAggregator.AvgFromAvg, RolapAggregator.AvgFromSum, RolapAggregator.BaseAggor, RolapAggregator.SumFromAvgfactCountExprAvg, Count, DistinctCount, enumeration, Max, Min, Sumdescription, name, ordinal| Constructor and Description |
|---|
AvgFromSum(String factCountExpr) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
alwaysRequiresFactColumn() |
String |
getExpression(String operand)
Returns the expression to apply this aggregator to an operand.
|
String |
getScalarExpression(String operand) |
aggregateaggregate, getNonDistinctAggregator, getRollup, isDistinct, supportsFastAggregatesequals, getDescription, getName, getOrdinal, toString, unexpectedpublic AvgFromSum(String factCountExpr)
public String getExpression(String operand)
RolapAggregatorgetExpression("emp.sal") returns
"sum(emp.sal)".getExpression in class RolapAggregatorpublic boolean alwaysRequiresFactColumn()
alwaysRequiresFactColumn in class RolapAggregator.BaseAggorpublic String getScalarExpression(String operand)
getScalarExpression in class RolapAggregator.BaseAggorCopyright © 2019 Hitachi Vantara. All rights reserved.