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)
Problem in Joint Data set !!!!!!!!!!
ganesh1984
Hi All,
I have a requirement of fetching records from a table where the second column in the result set will be filtered on one condition and remaining columns will be filtered on one condition.
I am using hibernate datasource. I am able to generate most of my reports accept this one.
Example :
Table - Customer
id | name | status | Birthdate
1 | 'ganesh' | 'APPROVED' | 23-05-1984
2 | ' Ram' | 'SUBMITTED' | 12-05-1984
I want to fetch the records which are grouped by month. My report should look some thing like this.
month | approvedCustomers | totalCustomers
5 | 1 | 2
each record gives the number of "Approved" customers and yet it also shows total number of customers in that particular month. records are grouped by month.
This is just an example. Actually i need to fetch around 10 columns. I tried to use subselect for fetching "APPROVED" customers in the select query. it doesn't works in Birt. Its working fine in Java Class. This would be a bug in Birt. Its just saying " Birt Exception ". when i test query it says " query is valid". when i try to see preview results it throws exception.
So I thought to using Two Datasets and joining them using Joint Data set .
In first data set i am fetching "APPROVED" customers grouped by month and in second data set i am fetching I am fetching all the records grouped by month.
Data set 1 :
month | approvedCustomers
5 | 1
Data set 2 :
month | totalCustomers
5 | 2
its woking fine upto here. I am getting what i wanted.
I am using joint Data set to join these data sets based on the key ' month '.
I am seeing result like this:
month | approvedCustomers | month | totalCustomers
5 | 2 | 5 | 2
why i am getting 2 in 'approvedCustomers ' . it should be 1.
For both the data sets i am using Customer table.
can some one please help me to solve this.
regards,
ganesh
Find more posts tagged with
Comments
JasonW
Ganesh,
Which ODA are you using? Where did you get it? You should be able to put multiple filter conditions on a dataset. Ie put the first filter condition for the second column and then add a new one for each of the remaining columns.
Jason
ganesh1984
Hi Jason,<br />
<br />
Thanks for the reply. I am using Hibernate data source. I am able to generate most of my reports. In all these reports i am using simple select query. <br />
<br />
I have gone through the following sites:<br />
<br />
1) <a class='bbc_url' href='
https://jira.jboss.org/jira/browse/JBIDE-2220'>https://jira.jboss.org/jira/browse/JBIDE-2220</a><br
/>
2) <a class='bbc_url' href='
http://docs.jboss.org/tools/3.0.0.GA/en/jboss_birt_plugin_ref_guide/html/birtSeamWebProject.html#d0e960'>Chapter
4. Birt Integration</a><br />
<br />
I am using eclipse plugins from the following sites:<br />
<br />
1) <a class='bbc_url' href='
http://download.eclipse.org/tools/ajdt/34/dev/update/'>http://download.eclipse.org/tools/ajdt/34/dev/update/</a><br
/>
2) <a class='bbc_url' href='
http://download.eclipse.org/releases/ganymede'>http://download.eclipse.org/releases/ganymede</a><br
/>
3) <a class='bbc_url' href='
http://download.jboss.org/jbosstools/updates/stable'>JBoss
Tools Stable Release Update Site: 3.0.1.GA-R200905070146-H18</a> <br />
<br />
<br />
can u please explain filtering with some more points using my example. It would be a great help.<br />
<br />
regards,<br />
ganesh
JasonW
Each filter that you add to either a dataset or a table is treated as an "and".
Ie if I add two filters, the row data must meat each expression or it is not included. Attached is a sample report with two filters on the dataset.
Jason