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)
Dynamically changing Data Set
arunstg1
Hi,
I have two data sets and i need to change the data set to be used dynamically based on the report parameter value.
Say if the Report Parameter = 'A' then i use DS1 if Report Parameter = 'B' then i need to use DS2.
Is it possible to do this.
Please help.
Thanks in advance.
Arun S.
Find more posts tagged with
Comments
mcremer
<blockquote class='ipsBlockquote' data-author="'arunstg1'" data-cid="80829" data-time="1312174515" data-date="31 July 2011 - 09:55 PM"><p>
Hi,<br />
<br />
I have two data sets and i need to change the data set to be used dynamically based on the report parameter value.<br />
<br />
Say if the Report Parameter = 'A' then i use DS1 if Report Parameter = 'B' then i need to use DS2.<br />
<br />
Is it possible to do this.<br />
<br />
Please help.<br />
Thanks in advance.<br />
Arun S.<br /></p></blockquote>
Arun,<br />
<br />
As long as your column names stay the same you can change the contect of the query.<br />
<br />
By clicking on the Data Set and then going to the Script. and set the script on the beforeOpen event<br />
You could do somtin glike this:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var year= params["getMINYEAR"].value;
var query = "select "+ year+" AS years, a.* FROM "+ jaar +"_overwiew_data a";
if (jaar != params["getMAXYEAR"].value) {
for(year = (params["getMINYEAR"].value + 1);year <= params["getMAXYEAR"].value; jaar++){
query = query + " UNION ALL select "+ year+" AS years, a.* FROM "+ jaar +"_overwiew_data a";
}
}
vars["debug"] = query;
this.queryText = query;
</pre>