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 on x-axis
gsakethreddy
<p>How can I sort "Months" on X-axis. </p><p> </p><p>They doesn't appear in order from Jan to Dec. Those are of text format.</p><p> </p><p>Thanks,
Saketh</p>
Find more posts tagged with
Comments
micajblock
<p>Is the data a date or a string? If it is a date use the date as the key and in the sorting and grouping use month as the group level</p>
gsakethreddy
<p>Thanks for your reply. It is as string.</p><p> </p><p>Thanks</p>
micajblock
<p>Then create a computed field that uses numbers and sort on that.</p>
gsakethreddy
<p>Can you please explain what exactly I have to do?</p>
micajblock
<p>What version of BIRT are you using?</p>
gsakethreddy
<p>BIRT version 2.5.1</p>
micajblock
<p>Sorry to hear you are on such an old version. Can't build an example, so I will do my best. First create a computed field (lets call it MonthNumber) on your data set make it an integer and the expression should be something like this:</p><div><pre class="_prettyXprint">if (row["Month"] == "Jan") {1}else if (row["Month"] == "Feb") {2}else if (row["Month"] == "Mar") {3}else if (row["Month"] == "Apr") {4}else if (row["Month"] == "May") {5}else if (row["Month"] == "Jun") {6}else if (row["Month"] == "Jul") {7}else if (row["Month"] == "Aug") {8}else if (row["Month"] == "Sep") {9}else if (row["Month"] == "Oct") {10}else if (row["Month"] == "Nov") {11}else {12}</pre><p>Then in the chart UI click on the 'Edit group and sorting' button in the data tab and set the sort on the computed field. See images attached (yours might vary slightly as it is an older version than mine)</p></div>
gsakethreddy
<p>Got you. Thanks for the Info. Actually, 2.5.1 is the only version of BIRT as of my knowledge that generates reports that are compatible with ARSystem of BMC Remedy. So, We are using 2.5.1 still.</p><p> </p><p>Thanks,</p><p>Saketh </p>