Home > ERP, Support, Technology > BI Bublisher: Selecting first record only

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.

Advertisements
  1. October 16, 2015 at 1:20 PM

    Those look like smart quotes possibly due to a word processor’s automatic conversion.

    • October 20, 2015 at 12:51 PM

      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.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: