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)
Grouping a column
info_js
Hello,
I am bringing rows of data from a database and I have grouped them based on a column name. Now I want to custom sort this column. Meaning - The column has four distinct values and hence there are 4 groups..I want to custom order these values, because using Ascending or Descending ordering, I am unable to view what I want to view first..Can I do custom order using BIRT? Please help me. I appreciate it.
Thanks.
Find more posts tagged with
Comments
kclark
How are you wanting to sort these? You can select your table > property editor > groups and create custom grouping here. I'm not sure how you want your data to be grouped but I attached a sample report showing how you can group quantity ordered by 10's.
info_js
My column values come from a database..
Say for eg: I am grouping customers based on the column 'city'...
And I want to specially monitor NY and NJ...I want to custom order them, In the the grouping, I want NY to come first, then NJ second and so on...
Tubal
<blockquote class='ipsBlockquote' data-author="'info_js'" data-cid="111319" data-time="1352323679" data-date="07 November 2012 - 02:27 PM"><p>
My column values come from a database..<br />
<br />
Say for eg: I am grouping customers based on the column 'city'...<br />
<br />
And I want to specially monitor NY and NJ...I want to custom order them, In the the grouping, I want NY to come first, then NJ second and so on...<br /></p></blockquote>
<br />
If this custom sort will always be the same, i.e. if you ALWAYS want to see NY and NJ first, then you could just replace those with 1 and 2 in your sort expression.<br />
<br />
For example, you'd put something like this in your sort expression:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>if(dataSetRow["city"]=="NY"){
"1";
} else if(dataSetRow["city"]=="NJ"){
"2";
} else {
dataSetRow["city"];
}</pre>
<br />
<br />
This will sort your data alphabetically on "city", but when it figures the sort, it will replace NY with 1 and NJ with 2.
info_js
Thanks for your reply, I have put your example expression in my test report..But it is not working..Do you have any example report that demonstrates the sort order..
Thanks for your help.
Tubal
<blockquote class='ipsBlockquote' data-author="'info_js'" data-cid="111329" data-time="1352350439" data-date="07 November 2012 - 09:53 PM"><p>
Thanks for your reply, I have put your example expression in my test report..But it is not working..Do you have any example report that demonstrates the sort order..<br />
<br />
Thanks for your help.<br /></p></blockquote>