tags:

views:

72

answers:

1

I have a pie chart in BIRT and about 80 data points. I'm looking to group them in three catagories <17 17-20 and >20. To be more specific I'm trying to make a red yellow green chart.

How can I do this. I tried the grouping function, but it only allows even intervals that I can find.

Thanks, Buzkie

A: 

Use a CASE expression in your query to produce a derived column:

SELECT someval, CASE WHEN (someval < 17) THEN 'Red'
    WHEN (someval >= 17 AND someval <= 20) THEN 'Yellow'
    ELSE 'Green' END AS wedgeColor
FROM sometable

and then you can bind the pie chart in BIRT to the derived column instead of the actual data point value.

Fred Sobotka