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)
Filter By Date difference
maheshkrishna
<p>Hi Experts,</p>
<p> </p>
<p>I am new to Birt Reports and need your help on the issue i am facing.</p>
<p>I was trying to filter by taking the date difference from the computed columns.</p>
<p>Below is the scenario:</p>
<p>I need to generate a report for which <span style="font-size:14px;">Filtering criteria should be</span></p>
<p><span style="font-size:14px;">1) </span><span style="font-size:14px;">Number of days 2,4,7 days </span></p>
<p> </p>
<p><span style="font-size:14px;">1. I have created a parameter with "string" data type and Display type as "List Box" and selection list values as "Static". In the values table i have provided the numbers 2, 4 and 7.</span></p>
<p><span style="font-size:14px;">2. From the computed columns created a new columns "Call PendingDays", Data type as "String" and in expression defined as below</span></p>
<p><span style="font-size:14px;"><b>if</b> (row["OPEN_TIME"]==<b>null</b>)</span></p>
<p><span style="font-size:14px;">{</span></p>
<p><span style="font-size:14px;">(((BirtDateTime.diffDay( row["OPEN_TIME"], BirtDateTime.today()))<= 7) </span></p>
<p><span style="font-size:14px;">((BirtDateTime.diffDay( row["OPEN_TIME"], BirtDateTime.today()))<= 4) </span></p>
<p><span style="font-size:14px;">((BirtDateTime.diffDay( row["OPEN_TIME"], BirtDateTime.today()))<= 2)) }</span></p>
<p><span style="font-size:14px;"><b>else</b></span></p>
<p><span style="font-size:14px;">row["OPEN_TIME"] </span></p>
<p>3. From "Filters", a new filter is created with</p>
<p>Expression: row["OPEN_TIME"] and Operator: Less than or Equal to and Value1: params["Rp PendingDays"].value.</p>
<p><span style="font-size:14px;">Please let me know where i am going wrong, i am new to Birt and was unable to generate the report.</span></p>
<p> </p>
<p><span style="font-size:14px;">Thanks in advance.</span></p>
<p><span style="font-size:14px;">Mahesh</span></p>
Find more posts tagged with
Comments
mwilliams
Okay. Let me see if I'm understanding. You want to let the user select a value for the parameter 2, 4, or 7. Given that selection, you want to return the rows that have an "OPEN_TIME" of less than that many days ago? Is this correct? If not, can you please explain some more? Maybe by using a simple example including data. Thanks.