Jump to content

BIRT Developer Center
Download


DevShare Source for user-contributed BIRT articles, tips and code

Devshare Home >> Sorting a Crosstab by a Field Not in the Crosstab
- - - - -

Sorting a Crosstab by a Field Not in the Crosstab

Download Resource

Summary:

Quick tip telling how to use the attribute feature of a crosstab dimension to sort the crosstab by a field from the dataSet that is not used in the crosstab.

Full Description:

Sometimes you want to sort a crosstab by a value from your dataSet that you don't care to see in the crosstab, whether it's a ranking or a custom order that you want for your crosstab dimension that isn't alphabetical or numerical. You can do this by adding an attribute to the dimension you want to sort in your dataCube.

To do this, you open your dataCube, double click on the dimension in the groups and summaries section of the dataCube editor, Click under attribute in the group level editor where it says "Create New Attribute" and select the column you want to sort by. This adds that field as an accessible field in your crosstab. So, now you can go to the sorting tab of the crosstab's property editor and sort the group you added the attribute to with a sort key like:
dimension["groupName"]["dimensionName"]["attributeName"]
An example report with this done is attached. It was designed in BIRT 2.5.2.


0 Comments