Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Sorting Data Sets
spriteburn
Hello,
Before I ask, I am working with Jazz Data Sources.
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 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.
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?
Thank you in advance.
Best regards,
Andrew
Edit
Find more posts tagged with
Comments
mwilliams
Hi Andrew,
What is your current query text like before doing the above in your beforeOpen script? Also, why don't you just make the "Order by" a part of your original query?
If you're just wanting to display this data in a table this way, you could bring the data our into a table, add your sort rules in the property editor for the table, and then add a column to your table and create a new binding that "ranks" the rows.
spriteburn
Hello mwilliams,<br />
<br />
Thank you for the quick response.<br />
<br />
The code in the beforeOpen script is the only code. I don't know how to write a custom SQL Query for a Data Set based off of a Jazz Data Source.<br />
<br />
What I want to do is create two Data Sets that are in this form (with the rank), then create a third data set which would join the first two using the ranks 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 tables.<br />
<br />
Regards,<br />
<br />
Andrew<br />
<br />
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="68170" data-time="1283869268" data-date="07 September 2010 - 07:21 AM"><p>
Hi Andrew,<br />
<br />
What is your current query text like before doing the above in your beforeOpen script? Also, why don't you just make the "Order by" a part of your original query?<br />
<br />
If you're just wanting to display this data in a table this way, you could bring the data our into a table, add your sort rules in the property editor for the table, and then add a column to your table and create a new binding that "ranks" the rows.<br /></p></blockquote>
mwilliams
Andrew,
How are you connecting to your Jass dataSource? With a SQL dataSet or in another way? Sorry, I have not used Jazz before.
spriteburn
Hello Michael,<br />
<br />
Thank you again for your reply.<br />
<br />
When creating a Data Source, one of the options is "Jazz Data Source" (I am using the BIRT plugin for Rational Team Concert) which allows me to connect to a set of snapshots from which I can extract my data. Based on these snapshots I can then create my Data Sets.<br />
<br />
I have uploaded a set of screenshots <a class='bbc_url' href='
http://i.imgur.com/v4rQW.jpg'>here</a>
; which might give you an idea. As you can see, there is no SQL querying on my part.<br />
<br />
Since I have a set of data, I am trying to modify the scripts to allow me to sort it, but unfortunately I cannot make it work. I am aware of the possibility of sorting it 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).<br />
<br />
Regards,<br />
<br />
Andrew<br />
<br />
<br />
<br />
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="68200" data-time="1283891132" data-date="07 September 2010 - 01:25 PM"><p>
Andrew,<br />
<br />
How are you connecting to your Jass dataSource? With a SQL dataSet or in another way? Sorry, I have not used Jazz before.
<br /></p></blockquote>
mwilliams
Andrew,
I don't see any attachments, but if you're not using SQL, adding an "order by" statement to the end probably won't help. If you're just joining the sorted dataSets together and want to display them like that, you might be able to use a two column grid and drop a table for each dataSet into its own grid cell, sort both tables on the same conditions and add a "rank" column to one of the tables. If it gets more complex than that, this may not work for you.