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)
Measure Order
Darcy
I have a report where I want the MeasureName to display in a particular order in a table. So I have set up a computed column in the data set as follows:
dataSetRow["MeasureOrder"]=null;
if(row["MeasureName"]=="# Deliberate Primary Fires")
{dataSetRow["MeasureOrder"]=1;}
if(row["MeasureName"]=="# Deliberate Sec. Fires")
{dataSetRow["MeasureOrder"]=2;}
if(row["MeasureName"]=="# Primary Fires")
{dataSetRow["MeasureOrder"]=3;}
I have used this method before and it worked, however, this time all I am getting in my table for the MeasureName is the measure order number. Any ideas?
Find more posts tagged with
Comments
mwilliams
Can you attach your design so I can see what you're doing?
Darcy
Report design attached.
mwilliams
I didn't see the computed column you talked about or any sorting conditions on the table, so I created a computed column and sort condition for you. It should do what you're wanting, I think. Unless I made some silly mistake that I didn't see.
Darcy
Hi Michael
I downloaded this file, copied and pasted it into my report and got an XML error. I've got our one and only XML person to have a look at it and we cannot find the error!
There are no sorting conditions on the table but the computed column should be there (there are however, a lot more entries - 20 in total!)
I tried copying in the bit I thought was needed but the column still did not order and only showed numbers instead of the descriptions required.
mwilliams
What column is only showing numbers and is supposed to show descriptions? Can you attach your design again? Maybe the one I got was not the correct one because I only saw 3 computed columns in the dataSet and none of them were it. Let me know if you're doing the computed field in the table. I just didn't see the name I was expecting for the field name.
Darcy
Hi
It is the first column (titled 'Indicator' where the computed column should act. I am setting up the computed column in the data set (that is the only way I know!). I have attached the file again. The computed column is called MeasureOrder and is the fourth computed column.
Darcy
Hi Michael
Any update for me?
mwilliams
Sorry for the delay, I was traveling all last week and working on the BIRT newsletter this week.
Ok, I think I understand now. The reason you're seeing a number is because you have the number field in the table. If you delete the MeasureOrder element and put the MeasureName element there instead, you'll see the name. Then, just select your table, go to the sorting tab and add a sort on MeasureOrder. That should do what you're wanting, I think. Let me know.
Darcy
Hi Michael
I tried that. I've got the Measure names back but the sort does not work, they still come out in their own random order!
mwilliams
Please attach your report how it is now. Thanks!
Darcy
Hello, Please find report attached. Sorry for the delay, I didn't get a notification this time!
Regards
Darcy
Report hopefully attached this time!
mwilliams
Try this. The only thing I did was change the grouping to group on the "MeasureOrder" field. When you set it up this way, you just delete the "MeasureOrder" element from the header and replace it with the "MeasureName" element, as it is now.
Hope this helps.
Darcy
Yay, that worked. Thanks for your help.
mwilliams
Not a problem. Let us know whenever you have questions!