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)
Using multiple Data Sets in one table - Dynamically
BIRTigo
Hi,
In BIRT 2.3
I'm trying to create a table that dynamically uses 3 data sets. These 3 data sets has identical columns (e.i Application Name, Date/Time and Number_of_Bytes). the difference of these 3 tables is the Date/Time which shows the data for days, weeks and months.
ex
Table1 DAYS
Application || Date/Time || Bytes
=======================================
snmp || 5/22/2008 13:25 || 87
snmp || 5/22/2008 14:52 || 154
pvuniwien || 5/22/2008 17:12 || 1358
pvuniwien || 5/22/2008 18:25 || 2356
ICMP_APPLN_0|| 5/22/2008 14:42 || 162
snmp || 5/29/2008 14:20 || 120
pvuniwien || 5/29/2008 13:45 || 1834
ICMP_APPLN_0 || 5/29/2008 14:24 || 232
ICMP_APPLN_0 || 5/29/2008 15:02 || 162
Table2 WEEKS
Application || Date/Time || Bytes
=======================================
snmp || 5/22/2008 0:00 || 241
pvuniwien || 5/22/2008 0:00 || 3714
ICMP_APPLN_0 || 5/22/2008 0:00 || 162
snmp || 5/29/2008 0:00 || 120
pvuniwien || 5/29/2008 0:00 || 1834
ICMP_APPLN_0 || 5/29/2008 0:00 || 349
Table3 MONTHS
Application || Date/Time || Bytes
=======================================
snmp || 5/2008 0:00 || 361
pvuniwien || 5/2008 0:00 || 5548
ICMP_APPLN_0 || 5/2008 0:00 || 511
Is it possible to dynamically use these three data sets in one table?
Please help.
Find more posts tagged with
Comments
Virgil Dodson
Hi BIRTigo,
You can use the beforeOpen event on the Data Set along with a parameter to dynamically decide which TXT file to open similar to below.
if (params["frequencyParam"].value == "Days") {
this.queryText = "select "Application", "DT", "Bytes" from table_days.txt : {"Application","Application",STRING;"DT","DT",STRING;"Bytes","Bytes",INT}";
} else if (params["frequencyParam"].value == "Weeks") {
this.queryText = "select "Application", "DT", "Bytes" from table_weeks.txt : {"Application","Application",STRING;"DT","DT",STRING;"Bytes","Bytes",INT}";
} else if (params["frequencyParam"].value == "Months") {
this.queryText = "select "Application", "DT", "Bytes" from table_months.txt : {"Application","Application",STRING;"DT","DT",STRING;"Bytes","Bytes",INT}";
}
To get the queryText syntax (like above) the first time, create a Flat File datasource and dataset, look at the XML Source, and search for queryText.
I put a quick example together to test this and it is enclosed.
birtq
Hi
One table can be linked with one data set only however you can have nested tables to display one table with data fetched from different datasets.
see the attachment.
Regards,
birtq