BI Bublisher: Selecting first record only
I was looking for a way to only select data from the first record of a group to use in my Master Bill of Lading. I only needed the address of one of the deliveries on the trip, so I wanted to select the address from the first delivery. The other deliveries on the trip would be have the same addresses, at least how we are configuring the system.
I found this on a blog post at Oracle.com which seemed to be the answer:
<?for-each:EMPLOYEES[position()='1' or position()=last()]?>
I tried it, and different combinations, for quite some time. I tried single quotes, double quotes, I tried it in an IF statement. It turns out the single quotes were causing problems. This is the way it finally worked:
<?for-each:LIST_TRIP_STOP/TRIP_STOP/LIST_DELIVERY/DELIVERY[position()=1]?>
I wonder if Oracle tested this before they published the blog entry. At least they pointed me in the right direction.
Those look like smart quotes possibly due to a word processor’s automatic conversion.
Good catch! However, the standard quotes also fail when attempted. Apparently this is done by WordPress automatically when rendering the text; how rude of it. Fixed by using the HTML code.