Pre-Defined Mixed Bucketization

PreDefinedMixedBucketization is a special variant of UserDefinedBucketization . A TLV containing this configuration is always executed in MIXED mode, without user input as to how to organize the buckets.

<TLVList xmlns="http://www.onenetwork.com/Platform">
<TLV>
<Name>ColumnHierarchyTLV</Name>
<PreDefinedMixedBucketization>
<Bucketization bucketCount="30">HOURLY</Bucketization>
<Bucketization bucketCount="30">DAILY</Bucketization>
<Bucketization bucketCount="4">WEEKLY</Bucketization>
</PreDefinedMixedBucketization>
<SqlDef Name="DataSql" GroupName="TlvSqls"><![CDATA[
SELECT item, site, the_date, quantity FROM item_by_site
]]></SqlDef>
.....
.....
</TLV>
</TLVList>

Bucketization in PreDefinedMixedBucketization has the following attributes:


  1. @bucketCount: Required. The number of buckets to be displayed.

For a TLV with PreDefinedMixedBucketization, only the Start Date is requested from the user.
images/download/attachments/144835652/mixed_timeline_filters-version-1-modificationdate-1645047477000-api-v2.png

Unlike UserDefinedBucketization, there are restrictions on the combined list of bucketizations allowable in PreDefinedMixedBucketization tag. These are the same limits placed on a user for UserDefinedBucketization, but for PreDefinedMixedBucketization, this constraint is enforced in the XML itself.

Permitted bucketization continuums for MIXED timeline are:

  • HOURLY - DAILY - WEEKLY

  • HOURLY - DAILY - SPLIT_WEEK - MONTHLY

  • HOURLY - DAILY - MONTHLY

  • HOURLY - DAILY - FISCAL_WEEK - FISCAL_MONTH - FISCAL_QUARTER - FISCAL_YEAR

In all of the above series, bucketization types that are not required can be skipped in the configuration. For example HOURLY - MONTHLY is valid.

When the TLV is executed with MIXED bucketization, additional parameters are bound to describe the boundaries of each bucket type. For every bucket type (including bucket types not selected in the current MIXED bucketization), parameters along the following lines are provided:

FIRST_HOURLY_BUCKET_INCLUSIVE
LAST_HOURLY_BUCKET_EXCLUSIVE
 
FIRST_DAILY_BUCKET_INCLUSIVE
LAST_DAILY_BUCKET_EXCLUSIVE
 
FIRST_WEEKLY_BUCKET_INCLUSIVE
LAST_WEEKLY_BUCKET_EXCLUSIVE

Each "FIRST" parameter captures the start date of that bucket type. Each "LAST" parameter captures the end date of the NEXT bucket type (that is why it is described as "exclusive"). This allows the author of the SQL to optionally add queries in the following style:

where (FORECAST_TYPE = 'DAILY' and FORECAST_DATE >= FIRST_DAILY_BUCKET_INCLUSIVE and FORECAST_DATE < LAST_DAILY_BUCKET_EXCLUSIVE)


For bucket types not present in the current MIXED bucketization selections, NULL will be bound for both FIRST and LAST.