Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Varying column number in dataset
Patrice
Hi all,
I want to build a chart, using a XML dataset whose column number can vary (I guess the problem would be the same with a SQL query result).
Each column is used to display a line on the chart.
Is it possible for BIRT to handle such a dataset ?
thanks for help
Find more posts tagged with
Comments
mwilliams
Hi Patrice,
Can you please explain this further? I don't think I'm fully understanding the issue. Thanks!
Patrice
Hi Michael,
I want to create a chart with several series, each displayed as a line chart, but the number of series is only known at runtime. My XML dataset looks like this :
<xValue>
<yValue>1</yValue>
<yValue>2</yValue>
<yValue>3</yValue>
<xValue>
<xValue>
<yValue>4</yValue>
<yValue>5</yValue>
<yValue>6</yValue>
<xValue>
Each <xValue> contains all the datpoint for a given x but the number of points for each X is unknown before the dataset is received, therefore I want BIRT to be able to display as many line charts as there are <yValue> in each <xValue>.
mwilliams
Patrice,
So, your actual data will look like the following in your dataSet?
X Value Y Value(YSeries#)
X1 Y1
X1 Y2
X1 Y3
X2 Y1
X2 Y2
X2 Y3
etc. etc.
If so, you could create a computed column to count the series. Pseudo code would be the following:
if(x is same as last x){
increment series counter;
output series counter;
}
else{
reset series counter;
output series counter;
}
This should give you:
X Value Y Value Series
X1 Y1 1
X1 Y2 2
X1 Y3 3
X2 Y1 1
X2 Y2 2
X2 Y3 3
etc. etc. etc.
You can then create your line chart with X Value as the X Category, Y Value as the Y Category, and use optional Y Series grouping of Series to separate the series in the chart. If I'm understanding your data correctly, something like this should work. Let me know if I'm way off.
Patrice
Michael,
Actually, my dataset, after being parsed by BIRT, looks like this :
x1 y1 y2 y3...
x2 y1 y2 y3...
and I'd like BIRT to be able to count the number of Y for each X and dynamically create new series if necessary.
A acceptable way to achieve this would be to declare more series than needed and tell BIRT to disable series for which no data were found in dataset at runtime.
mwilliams
Patrice,
Oops, I goofed on the XML. Should have done more than glance I guess. I'll have to look at it the right way and see if I can figure something out. I'll let you know if I do. Good luck!
Patrice
Thanks for your help Michael.
Patrice