Column Hierarchy

The ColumnHierarchy element provides functionality for a user to define columns to categorize data measures in separate rows. Attributes can also be defined for the column and they will be displayed within the column.

<TLVList xmlns="http://www.onenetwork.com/Platform">
<TLV>
<Name>ColumnHierarchyTLV</Name>
<Bucketization>DAILY</Bucketization>
<BucketsPerPage>7</BucketsPerPage>
<SqlDef Name="DataSql" GroupName="TlvSqls"><![CDATA[
SELECT item, site, the_date, quantity FROM item_by_site
]]></SqlDef>
 
<SqlDef Name="AttSql" GroupName="TlvSqls"><![CDATA[
SELECT item, site, site_id, site_desc, site_desc2, site_desc3 FROM item_by_site_info
]]></SqlDef>
 
<Filters bindSqlNulls="true">
<CustomFilterField>
<FieldRef category="PDF" levelType="Undefined">
<FieldName>DateRange</FieldName>
</FieldRef>
<Hidden>false</Hidden>
<Editable>true</Editable>
<Type>DATE_RANGE</Type>
<Optional>false</Optional>
<DateRangeMapping fromSqlName="DATE_RANGE_START" toSqlName="DATE_RANGE_END"/>
</CustomFilterField>
<DateRange start="$NULL$" end="$NULL$"/>
</Filters>
<ColumnHierarchy>
<VerticalPageSize>5</VerticalPageSize>
<Column>
<Name>item</Name>
</Column>
<Column>
<Name>site</Name>
<Attribute hidden="true">
<Name>site_id</Name>
<SqlDefName>AttSql</SqlDefName>
</Attribute>
<Attribute>
<Name>site_desc</Name>
<SqlDefName>AttSql</SqlDefName>
</Attribute>
<Attribute>
<Name>site_desc2</Name>
<SqlDefName>AttSql</SqlDefName>
</Attribute>
<Attribute>
<Name>site_desc3</Name>
<SqlDefName>AttSql</SqlDefName>
</Attribute>
</Column>
</ColumnHierarchy>
 
<DM bucketization="DAILY" editable="true">
<Name>DMA</Name>
<DisplayName>DM A</DisplayName>
<SqlDefName>DataSql</SqlDefName>
<SqlQuantityField levelType="Undefined">
<FieldName>quantity</FieldName>
</SqlQuantityField>
<SqlDateField levelType="Undefined">
<FieldName>the_date</FieldName>
</SqlDateField>
</DM>
</TLV>
</TLVList>

Above is an example of a two-level column hierarchy with multiple attributes defined. VerticalPageSize determines the number of rows to be displayed vertically in one page.

It is important to note that:

  1. Only STRING fields are supported for ColumnHierarcy columns.

  2. Attributes are only displayed in the deepest level column. In our example, attributes will only be displayed in the site column.
    images/download/attachments/144835662/TLVWithColHierarchy-version-1-modificationdate-1645047530000-api-v2.png