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)
conditional SQL query in report DataSet
ramanareddy438
<p>Hi,</p>
<p> </p>
<p>I want to add a condition based on the value of the report parameter. Like if the parameter value is null, don't include the condition, otherwise, add the condition. Please refer the attached image where I want to add the condition. In the screenshot, <span style="background-color:rgb(243,168,163);">I</span> want to add column2 condition if the report parameter is not null. Please help me.</p>
<p> </p>
<p>Regards</p>
<p>Ramana Reddy</p>
Find more posts tagged with
Comments
sureshpulapalli
<p>Hi Ramana,</p>
<p> </p>
<p>you can update the query in beforeOpen() method of the dataset. here is the sample code, hope this will help.</p>
<p> </p>
<p> </p>
<div>var qry=this.queryText;</div>
<div> </div>
<div>if (params["customerNumber"].value !=null && params["customerNumber"].value!="")</div>
<div>qry=qry + " where CUSTOMERNUMBER="+params["customerNumber"].value;</div>
<div> </div>
<div>this.queryText=qry;</div>
<p> </p>
<p><strong>customerNumber </strong>is report Parameter.</p>
<p> </p>
<p>Regards,</p>
<p>Suresh</p>