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)
Multi-select report parameter for dates
mihika.shah
<p>Hello,</p>
<p> </p>
<p>I'm trying to add a report parameter (<strong>multi-select</strong>) which has the value as follows:</p>
<p> </p>
<p>- All</p>
<p>- Future Payments</p>
<p>- Current Payments</p>
<p>- Past Payments</p>
<p> </p>
<p>Depending on the values that you select on the report parameter, I need to add a filter on the data set to display only those records which matches below condition.</p>
<p> </p>
<p>- Future Payments : Payment_Start_Date > Current Date</p>
<p>- Current Payments : Payment Start Date < Current Date < Payment End Date</p>
<p>- Past Payments : Payment End Date < Current Date</p>
<p> </p>
<p>So if the user selects both 'Future' and 'Past' report parameter values while running the report, it should only return the respective records only. </p>
<p> </p>
<p>Can anyone help me to set up this? Please let me know if any further info is required. </p>
<p> </p>
<p> </p>
<p> </p>
Find more posts tagged with
Comments
micajblock
<p>read this post <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/39744-report-working-like-a-seach-engine'>http://developer.actuate.com/community/forum/index.php?/topic/39744-report-working-like-a-seach-engine</a></p>
;
mihika.shah
<p>I have added the below filter on the data set for the condition when user selects the 'Past' value only from the report parameter.</p>
<p> </p>
<p><strong>Expression:</strong></p>
<p> </p>
<div>var d=new Date(Formatter.format(row["triIntermediate__triREContractLocations____triEffectiveEndDA"],"MM/dd/YYYY"));</div>
<div>var e=new Date(Formatter.format(BirtDateTime.today(),"MM/dd/YYYY"));</div>
<div>var val = String(params["Area Location"].value);</div>
<div> </div>
<div>if ( val == 'Past' )</div>
<div>{</div>
<div>if(BirtComp.lessThan(d,e))</div>
<div>{</div>
<div>true;</div>
<div>}</div>
<div>else</div>
<div>{</div>
<div>false;</div>
<div>}</div>
<div>}</div>
<div> </div>
<div> </div>
<div><strong>Operator:</strong></div>
<div> </div>
<div>Is True</div>
<div> </div>
<div>For some reason, it is displaying no records. Can anyone please suggest?</div>
micajblock
<p>Is your data source a relational database? If not, what is it?</p>
mihika.shah
<p>No, it's a scripted data source. I work on IBM TRIRIGA tool and we use BIRT reports along with that. It allows us to export queries from the tool in such a way that when it's imported in Eclipse, scripted data source gets created automatically. </p>
micajblock
<p>See attached example. In case you cannot open it as I know <span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">TRIRIGA uses an old version of BIRT, my filter has the below expression equal to 1.</span></p>
<pre class="_prettyXprint">
// a multi select list returns an array of objects this will convert to a comma delimited string
var ar = params["Payment"].value.join(",");
var today =new Date();
var tmp = 0;
if (ar.indexOf("All")>=0) {tmp = 1}
if(ar.indexOf("Future Payments")>=0 && row["Payment Start Date"] > today) {tmp = 1}
if(ar.indexOf("Current Payments")>=0 && row["Payment Start Date"] < today && row["Payment End Date"] > today) {tmp = 1}
if(ar.indexOf("Past Payments")>=0 && row["Payment End Date"] < today) {tmp = 1}
tmp;</pre>