Class AttributeSortItem
java.lang.Object
com.gooddata.sdk.model.executeafm.resultspec.AttributeSortItem
- All Implemented Interfaces:
SortItem
public class AttributeSortItem extends java.lang.Object implements SortItem
Define sort by specific attribute
With "aggregation" active you can sort all elements of attribute
by "aggregation fn" applied to all valid values belonging to each
element. This is extremely useful when sorting stacked
visualizations like stack bar/area charts. Currently supported is
only "sum", see AttributeSortAggregation
Simple example (dimension = Year, measureGroup; 2 metrics; sort on Year with aggregation="sum", descending):
Year 2006 2007 Names M1 M2 M1 M2 Values 1 2 3 4
We take all values belonging to each attribute element of chosen attribute and apply selected function (sum) on them. Notice that we are summarising values from different metrics:
2006 (1 + 2 = 3) 2007 (3 + 4 = 7)
After that we shuffle year attribute elements related to results from "sum" function:
Year 2007 2006 Names M1 M2 M1 M2 Values 3 4 1 2
-
Constructor Summary
Constructors Constructor Description AttributeSortItem(Direction direction, java.lang.String attributeIdentifier)AttributeSortItem(Direction direction, java.lang.String attributeIdentifier, AttributeSortAggregation aggregation)AttributeSortItem(java.lang.String direction, java.lang.String attributeIdentifier)AttributeSortItem(java.lang.String direction, java.lang.String attributeIdentifier, java.lang.String aggregation) -
Method Summary
Modifier and Type Method Description java.lang.StringgetAggregation()java.lang.StringgetAttributeIdentifier()java.lang.StringgetDirection()java.lang.StringtoString()
-
Constructor Details
-
AttributeSortItem
public AttributeSortItem(java.lang.String direction, java.lang.String attributeIdentifier, java.lang.String aggregation) -
AttributeSortItem
public AttributeSortItem(java.lang.String direction, java.lang.String attributeIdentifier) -
AttributeSortItem
-
AttributeSortItem
public AttributeSortItem(Direction direction, java.lang.String attributeIdentifier, AttributeSortAggregation aggregation)
-
-
Method Details
-
getDirection
public java.lang.String getDirection() -
getAttributeIdentifier
public java.lang.String getAttributeIdentifier() -
getAggregation
public java.lang.String getAggregation() -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-