The UnCrosstab Filter
The UnCrosstab Filter element is used with datalayer elements to "un-pivot" or "reverse pivot" rows of data into columns of data. It converts one row of multi-column data into multiple rows, each with a single data value. This topic discusses use of this element.
This element is not available in Logi Report.
About the UnCrosstab Filter
The UnCrosstab Filter element, introduced in v10.1.18, is available for use with all datalayer elements and is the functional opposite of the Crosstab Filter element.
In operation, the element basically converts each row in the datalayer, each of which has multiple columns, into multiple rows, each of which has one value column.
It's a little easier to understand the filter's actions when you can see the effect limited to one row, in a data table, as shown above.
This "un-pivot" action normalizes the data on the fly and, among other applications, can be really useful when having to work with data imported from spreadsheets.
The following example illustrates how the UnCrosstab Filter is used:
- As shown above, an UnCrosstab Filter element is added as a child beneath a datalayer element.
- Its Column Heading ID attribute value is set to the column used to provide the original pivoted column headings.
- The Value Column ID attribute is set to name of a new column that will receive the data values.
- The optional Label Columns attribute identifies one or more columns, in a comma-separated list, that are not pivoted.
- The optional Remove Columns attribute identifies one or more columns, in a comma-separated list, that should not be included in the output.
In the complete example above, the sequence of events is that the datalayer reads in all the data from the XML data file, then the UnCrosstab Filter builds a substitute datalayer by examining each row in the source datalayer and adding rows to the substitute datalayer for each value column found.
The UnCrosstab Filter element also has an Include Condition attribute:
If the value of this attribute is left blank or contains a formula that evaluates to True, the element is applied to the datalayer. If the value evaluates to False, the element is ignored and does not affect the datalayer. This powerful feature allows developers to dynamically determine if the datalayer will be altered or not.