Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

BIRT: Sorting Data Sets

Good Morning,

I am trying to create a BIRT data set that is sorted (1) by WI_ID and (2) by TIME_ID.TIMESTAMP so as to have a list of all work items ordered by ID and timestamp, with a computed column ranking them. For example i would like to have the following result:

FACT_ID 2 | WI_1 | 1 Sep 2010 16:03 | RANK 1
FACT_ID 5 | WI_1 | 1 Sep 2010 16:30 | RANK 2
FACT_ID 3 | WI_2 | 1 Sep 2010 16:05 | RANK 3
FACT_ID 6 | WI_2 | 1 Sep 2010 16:40 | RANK 4
FACT_ID 1 | WI_3 | 1 Sep 2010 15:17 | RANK 5
FACT_ID 4 | WI_3 | 1 Sep 2010 16:25 | RANK 6

Since I cannot do this without reading the data into some sort of variable, please can I have some information on how to do this? Also, how do I then take replace the data set with the sorted information, making sure that the rank column is added? I have found many tutorials, but I cannot make enough sense of them to be able to do what I want.

Thank you in advance.

Best regards,

Andrew

Edit

I tried adding the following code to the beforeOpen script of my data set:

queryString = this.queryText;
queryString = queryString + " ORDER BY WI_ID ASC";
this.queryText = queryString;

Unfortunately it does not work. Is there anything else I can do?

0 votes



2 answers

Permanent link
Sorting is accomplished by using the sort tab of the Properties Editor of the table.

Good Morning,

I am trying to create a BIRT data set that is sorted (1) by WI_ID and (2) by TIME_ID.TIMESTAMP so as to have a list of all work items ordered by ID and timestamp, with a computed column ranking them. For example i would like to have the following result:

FACT_ID 2 | WI_1 | 1 Sep 2010 16:03 | RANK 1
FACT_ID 5 | WI_1 | 1 Sep 2010 16:30 | RANK 2
FACT_ID 3 | WI_2 | 1 Sep 2010 16:05 | RANK 3
FACT_ID 6 | WI_2 | 1 Sep 2010 16:40 | RANK 4
FACT_ID 1 | WI_3 | 1 Sep 2010 15:17 | RANK 5
FACT_ID 4 | WI_3 | 1 Sep 2010 16:25 | RANK 6

Since I cannot do this without reading the data into some sort of variable, please can I have some information on how to do this? Also, how do I then take replace the data set with the sorted information, making sure that the rank column is added? I have found many tutorials, but I cannot make enough sense of them to be able to do what I want.

Thank you in advance.

Best regards,

Andrew

Edit

I tried adding the following code to the beforeOpen script of my data set:

queryString = this.queryText;
queryString = queryString + " ORDER BY WI_ID ASC";
this.queryText = queryString;

Unfortunately it does not work. Is there anything else I can do?

0 votes


Permanent link
Hello Kirk,

Thank you for your reply.

I am aware of the possibility of sorting within the layout, but the data sets that I am trying to sort represent the first step of the final data set (which will be a join between the two) that I want to use in the layout.

What I want to do is create two data sets that are in the above mentioned form (with rank), then create a third data set which would join the first two using the rank as key that I can then use in the report layout. In order for it to work, though, I need to be able to sort the first two data sets using some sort of script.

Regards,

Andrew

Sorting is accomplished by using the sort tab of the Properties Editor of the table.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927

Question asked: Sep 07 '10, 4:11 a.m.

Question was seen: 9,121 times

Last updated: Sep 07 '10, 4:11 a.m.

Confirmation Cancel Confirm