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)
Using parameters to update/change query
Marcrazy
Hello,
I have a query in Birt like this:
select count(*)
from aTable
left outer join bTable on aTable.bTable_id = bTable.id
where (? = 'aTable' and aTable.date between {ts ?} and {ts ?})
or (? = 'bTable' and bTable.date between {ts ?} and {ts ?})
I want to be able to change it to this or something similar:
select count(*)
from aTable
left outer join bTable on aTable.bTable_id = bTable.id
where (?)
Where I can update that last parameter to be whatever I want using a function like if aTable then filter on aTable dates. Is this possible? I tried using a function and no luck.
? = aTable.date between DATE_PARAM_1 and DATE_PARAM_2
Thanks
Find more posts tagged with
Comments
kclark
You can modify the query from beforeOpen() of the data set. I'm not clear on what your trying to do but if you have some data passed to your report from a parameter you could do something like this<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var myParam = params["NewParameter"].value;
if(myParam == "something") {
this.queryText = "select * from something"; // new query
}
</pre>