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)
Conditional (Specified) BIRT Group Sort
JDD
Hi, I need help to create a conditional sort in BIRT. I am able to create a group sort return using a specified sorting order in Crystal Reports; however, in BIRT, that doesn't seem possible. I seem to be limited to the ascending/descending options.
I have a group within a table that returns "Test Status". I want the Test Status group to return the status values in a specified order (e.g,. (1)Passed, (2)Failed, (3)Warning, (4)Not Tested, ...).
Here's what I've tried:
I created a Computed Column with the intentions to map the values to force a specified sort. To do so, I used the script below, but all I get are zeros for all records returned. Here's the script:
###############################
var status_code = 0;
switch(row)
{
case 'Passed':
status_code = 1;
break;
case 'Failed':
status_code = 2;
break;
case 'Warning':
status_code = 3;
break;
case 'Not Tested':
status_code = 4;
break;
default:
break;
}
status_code
########################
When I try create a Value Map I get only a zeros for all records (vice 0,1,2,3,4) returned when I attempt to use the Select Value Map option.
What's wrong with my script / what am I doing wrong; or is there a better approach?
Any help would be greatly appreciated (BIRT Beginner - script above provided by IBM Rational ClearQuest forum contributor).
Thanks in advance for any help.
JDD/BIRT 2.1
Find more posts tagged with
Comments
mwilliams
Hi JDD,
You need to have 'case(row["string_status_field"])' instead of just 'case(row)'. Then that should work just fine.