EDIT: Sorry. Title should be "Passing a MULTI VALUED Parameter for plotting a chart".
Hi,
In my previous topic (
http://www.birt-exchange.org/org/forum/index.php/topic/25022-using-output-of-one-dataset-in-query-of-another/page__pid__98383__st__0&) I assigned a value to a parameter and used it as a table name in my second query.
Now I need to assign multiple values to a parameter with the idea of my second query plotting a graph.
Data Set #1 returns seven daily table names, along with corresponing dates that I want to use as the x axis.
eg:
table | Date
+
table_20120401_daily | 20120401
table_20120402_daily | 20120402
table_20120403_daily | 20120403
table_20120404_daily | 20120404
table_20120405_daily | 20120405
table_20120406_daily | 20120406
table_20120407_daily | 20120407
I have two paramaters, pTables and pDates. Their settings:
Scalaer parameter type: Multi Value
Value type: Dynamic
Correct DataSetName, Label and Value expressions, etc assigned.
DataSet #1 onFetch:
params["pDates"].value = row["stdate"];
params["pTables"].value = row["table"];
(Don't know if I'm / how to assign the multiple values to the parameters. So far I think this only taking the last one)
Data Set #2 beforeOpen:
this.queryText = this.queryText.replace("DateName", params["pDates"].value);
this.queryText = this.queryText.replace("TableName", params["pTables"].value);
Data Set #2 Query:
select DateName as date, QtySold
from TableName;
(I want to run the Data Set #2 query for each of the seven table names I got from DS #1, and return...
Date | QtySold
+
20120401 | 14
20120402 | 16
20120403 | 11
20120404 | 5
20120405 | 9
20120406 | 12
20120407 | 11
For plotting on a graph).
Don't know what the next steps I need to do to acheive this are.
Any help much appreciated.
Thanks,
Luke