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)
How to add report parameter to result set conditionally?
higleyjp
<p>Hello there,</p>
<p> </p>
<p>I'm trying to create a report that will use conditional formulas to insert a report parameter into one of three columns in my result set. The solution is for a reminder email we send out the first week of each month. One of the parameters of the report will be the "EmailDate" or the date that the emails get sent (not necessarily the same day as the report is run). The result set should include data from the SQL data set along with 3 columns: "Reminder," "60Day," and "90Day." The report should conditionally enter the parameter value in the appropriate column based on DueDate from the database.</p>
<p> </p>
<p>Example: If running the report for January, ActionDate would be 1/5/2015 and if the due date falls during January, then 1/5/2015 should be entered in the Reminder column. If the due date falls in February, then it should be in the 60Day column. March due dates would have the ActionDate in the 90Day column.</p>
<p> </p>
<p>These columns are currently set up manually, then the data is loaded into Access as the source for a mail merge to send the appropriate emails.</p>
<p> </p>
<p>Thanks for your help!</p>
<p>Justin</p>
Find more posts tagged with
Comments
JFreeman
<p>Have you considered using computed columns for these three columns?</p>
<p> </p>
<p>Within the computed columns you can using scripting to read the Date/Time parameter and determine the appropriate value to populate for each column.</p>
higleyjp
<p>Thanks! I ended up bringing the parameter into the report and created a new data binding referencing the param value and using the BirtDateTime.diffMonth() function to determine whether the due date falls during the current, next, or subsequent month.</p>
<div>
<pre class="_prettyXprint">
if(BirtDateTime.diffMonth(params["ActionDate"], dataSetRow["DueDate"]) == 0) {
//for current month, or ...== 1 for next month, or ...== 2 for the month after that
params["ActionDate"]
}
else {
null
}</pre>
</div>
JFreeman
<p>Thanks for the details on your solution.</p>
<p>I am glad to hear you got it working.</p>