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)
FIRST Aggregation function in BIRT
mihika.shah
<p>Hello,</p>
<p> </p>
<p>Can anyone please let me know how does the First function in aggregation works?</p>
<p> </p>
<p>I have created an aggregation named 'Option Type' to find out the Option with Minimum date. Aggregation Properties are as below.</p>
<p> </p>
<p>Function: FIRST</p>
<p>Expression: OptionType</p>
<p>Filter Condition: Minimum date of the Options</p>
<p>Group By : Lease ID</p>
<p> </p>
<p>For example, I have a lease ID 1234 with three Options associated with it as below</p>
<p> </p>
<p>Option ID Option Type Option Date </p>
<p> </p>
<p>4150 Tenant Break 01/10/2017</p>
<p>3246 Rent Review 01/10/2017</p>
<p>5240 Lease End 30/09/2019</p>
<p> </p>
<p>The result gives me Tenant Break as the Option Type with minimum date of 01/10/2017 and that's correct. But why does it not give Rent Review as the result? How does the FIRST function works?</p>
<p> </p>
<p>Appreciate any help. Thanks in advance!</p>
Find more posts tagged with
Comments
jfranken
<p>The "FIRST" aggregation function returns the value in the first row of the table or group. Since you aren't doing any sorting, the row with Option Type = "Tenant Break" must be the first row that was entered in the DB of the rows not being filtered out. You need to sort the table on the report, or using "order by" in the query should also work. </p>
mihika.shah
<p>Thanks Jeff for your help.</p>