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 in Table
mh10
Hi,
I have column with vlaues
ABC 1
ABC 2
ABC 3
.
.
.
.
ABC 10
I have inserted group in table on this column. and i am looking to display group details in order as it is with above column values. so i put sort key on this column as ascending..
but it shows group details with
ABC 1
ABC 10
I WANT "ABC 10" group detail at last position
ABC 2
ABC 3
.
.
.
ABC9
Any suggestions?
Find more posts tagged with
Comments
bhanley
This is a problem with all alphanumeric sorts. The sorting engine in BIRT can handle this without a lot of additional work on your part. You need to make one change to your data (if possible).<br />
<br />
Right now your data look like this:<br />
<br />
<blockquote class='ipsBlockquote' ><p>ABC 1<br />
ABC 10<br />
ABC 2<br />
ABC 3</p></blockquote>
<br />
If you can change them to read in the following format, they will sort correctly without any more scripting work for you:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>ABC 01
ABC 02
ABC 03
ABC 10</pre>
<br />
BIRT (and JavaScript for that matter) can successfully deal with the alpha numerics if the strings and numbers are consistent. This example will work for numbers through 99. If you need higher values, add more elading zeros.<br />
<br />
I have attached a sample where I add a comuted column to the data saet with alpha-numeric values and then sort by that column. Look at the expression building the computed column to see how to padd the numeric portion of the column value with the required leading zeros.<br />
<br />
Hope this helps, good luck!
mh10
Thanks bhanley,<br />
It worked with 01, 02, 03......10<br />
<br />
<br />
<br />
<blockquote class='ipsBlockquote' data-author="bhanley"><p>This is a problem with all alphanumeric sorts. The sorting engine in BIRT can handle this without a lot of additional work on your part. You need to make one change to your data (if possible).<br />
<br />
Right now your data look like this:<br />
<br />
<br />
<br />
If you can change them to read in the following format, they will sort correctly without any more scripting work for you:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>ABC 01
ABC 02
ABC 03
ABC 10</pre>
<br />
BIRT (and JavaScript for that matter) can successfully deal with the alpha numerics if the strings and numbers are consistent. This example will work for numbers through 99. If you need higher values, add more elading zeros.<br />
<br />
I have attached a sample where I add a comuted column to the data saet with alpha-numeric values and then sort by that column. Look at the expression building the computed column to see how to padd the numeric portion of the column value with the required leading zeros.<br />
<br />
Hope this helps, good luck!</p></blockquote>