Please help : How to remove duplicates in BIP

Hi All,
As told you all before that i have just started using the BIP and now i am facing an issue filtering out the duplicates from the sql query. Following is the issue and the output which i want.
This is how the data is ( example)
Srno product_id product_name
1 AAX2 conntx
1 AAX3 symmtx
2 AAX4 seagte
3 BBZ3 harddx
4 LLN7 ddr
4 LLN5 ddr1
the above data is sorted on snro ascending
Now i want the data last record for all the duplicates srno's for ex: for srno 1 and srno 4, i want to select the record with the product AAX3 and LLN5 resp and i want to implement the same at the rtf template level and not sure of the xml logic which i should use. i know i can do this at the db level using the oracle's lag function but then there are performance issues with it.
Can anybody please tell me the logic to eliminate the duplicates at the rtf template level.
Please treat this as urgent!
Thanks
Ronny

You may group by SRNO and then check the current position within the group to equal the group count. Here is the example:
The XML:
<ROWSET>
     <ITEM>
          <SRNO>1</SRNO>
          <PRODUCT>AAX2</PRODUCT>
          <DESC>conntx</DESC>
     </ITEM>
     <ITEM>
          <SRNO>1</SRNO>
          <PRODUCT>AAX3</PRODUCT>
          <DESC>symmtx</DESC>
     </ITEM>
     <ITEM>
          <SRNO>2</SRNO>
          <PRODUCT>AAX4</PRODUCT>
          <DESC>seagte</DESC>
     </ITEM>
     <ITEM>
          <SRNO>3</SRNO>
          <PRODUCT>BBZ3</PRODUCT>
          <DESC>harddx</DESC>
     </ITEM>
     <ITEM>
          <SRNO>4</SRNO>
          <PRODUCT>LLN7</PRODUCT>
          <DESC>ddr</DESC>
     </ITEM>
     <ITEM>
          <SRNO>4</SRNO>
          <PRODUCT>LLN5</PRODUCT>
          <DESC>ddr1</DESC>
     </ITEM>
</ROWSET>The template:
<?for-each-group:ROWSET/ITEM;SRNO?>
   <?for-each:current-group()?>
      <?if:position()=count(current-group()/SRNO)?>
          <?SRNO?>   <?PRODUCT?>  <?DESC?>
      <?end if?>
   <?end for-each?>
<?end for-each-group?>The result:
1 AAX3 symmtx
2 AAX4 seagte
3 BBZ3 harddx
4 LLN5 ddr1

Similar Messages

  • HT3702 How can I stop and remove my credit card from my iPad ,my children keep buying games and I want to stop it......please help me to remove any payment from now on.

    How can I stop and remove my credit card from my iPad ,my children keep buying games and I want to stop it......please help me to remove any payment from now on.

    iOS: Understanding Restrictions
              http://support.apple.com/kb/HT4213

  • My ipad2 is asking old id password, when i go to forget password link for that id then I am not getting any mail to reset the same. Please help how can i remove or change the old id.

    my ipad2 is asking old id password, when i go to forget password link for that id then I am not getting any mail to reset the same. Please help how can i remove or change the old id.

    You cannot remove or change the old ID. This is Find My iPhone Activation Lock. You need to recover the credentials for the Apple ID originally used to activate the iPad.
    Check your spam and junk folders.

  • Help needed in removing duplicate items of list box  in java

    How to remove duplicate items of list box while dynamically inserting (on-click event)
    It is not identifying duplicate data
    Variable name is HP_G1
    HP_dmg1 = (DefaultListModel) HP_G1.getModel();
    int a = HP_G1.getModel().getSize();
    System.out.println("HP list no--------> "+a);
    if(a!=0)
    for (int j=0; j<a; j++)
    String item1 = String.valueOf(HP_List.getModel().getElementAt(j));
    System.out.println("HP list added--------> "+item1);
    if(HP_dmg1.equals(item1)){
    HP_dmg1.remove(j);
    else
    HP_dmg1.addElement(GPL);
    }

    Your code is unreadable, so I'll ignore it. In the future please press the message editor's CODE button to format code.
    As to your problem, to the point you normally use a Set instead of List when you don't want duplicates in a collection.

  • TS3999 how to remove duplicate Birthday entries in icloud on my PC

    how to remove duplicate Birthday entries in icloud on my PC
    The Birthday entries on my iPad are ok.

    Welcome to the Apple Community.
    The following article(s) may help you.
    Resolving duplicate calendars

  • Please Help,how do i get my iphone 4 to play all my songs from icloud, it is currently only playing just a smal number of songs from my library which is stored in icloud.

    Please Help,how do i get my iphone 4 to play all my songs from icloud, it is currently only playing just a smal number of songs from my library which is stored in icloud.

    There are a number of OS X apps, many free, that will save your messages, allowing to view and print them. 
    http://www.softwarebbs.com/wiki/How_to_transfer_SMS_from_iPhone_to_Mac,_backup_i Phone_SMS_message_on_Mac
    Google, for other options
    Your "other" of 6 GB may include corrupted data or file sytem errors. If after removing the messages there is still >2GB, you will need to restore the phone in iTunes, first using a backup (made after deleting the messages) and if needed as a new iPhone.
    iTunes: Restoring iOS software

  • How to Remove Duplicates Without Changing Album?

    Hello All,
    I see a lot of topics on how to remove duplicate songs but there is one thing I would like to know if its possible...
    I would like to remove my duplicates but I still want to see the songs as part of the albums. Example: lets say the same song is present in 3 different albums. I would like to remove 2 of them but have them still showing up as part of the 3 albums. This way the albums remain "complete".
    Is there any way to tool available that can do that? Maybe keeping something like a symbolic link in place of the songs that were deleted?
    Any help would be appreciated.
    Thanks!

    Not possible and has been asked before.
    MJ

  • How to remove duplicate songs in iTunes?

    Please advise me how to remove duplicate songs in iTunes? Thank you

    THIS is how you remove them, Once you done this...Press and Hold Command on All Music and then Delete and your Done.

  • Hi, please help my other daughter her ipod touch is disabled connect to itunes after say its itunes couldnt connect to the ipod touch coz its is locked with a passcode?? please help how...

    hi, my daughter hers ipod touch is disabled connect to itunes after say its itunes couldnot connect to the "ipod touch" because its is locked with a passcode please help how to fix connect...i did turn off her ipod touch put usb back on there same in doenot say still ipod is disabled i dont understand please help how???

    If You Are Locked Out Or Have Forgotten Your Passcode or Just Need to Restore Your Device
      1. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
      2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
      3. iOS- Understanding passcodes
         If you have forgotten your Restrictions code, then follow the instructions
         below but DO NOT restore any previous backup. If you do then you will
         simply be restoring the old Restrictions code you have forgotten. This
         same warning applies if you need to restore a clean system.
    A Complete Guide to Restore or Recover Your iDevice (if You Forget Your Passcode)
    If you need to restore your device or ff you cannot remember the passcode, then you will need to restore your device using the computer with which you last synced it. This allows you to reset your passcode and re-sync the data from the device (or restore from a backup). If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present. Refer to Updating and restoring iPhone, iPad and iPod touch software.
    Try restoring the iOS device if backing up and erasing all content and settings doesn't resolve the issue. Using iTunes to restore iOS devices is part of standard isolation troubleshooting. Restoring your device will delete all data and content, including songs, videos, contacts, photos, and calendar information, and will restore all settings to their factory condition.
    Before restoring your iOS device, Apple recommends that you either sync with iTunes to transfer any purchases you have made, or back up new data (data acquired after your last sync). If you have movie rentals on the device, see iTunes Store movie rental usage rights in the United States before restoring.
    Follow these steps to restore your device:
         1. Verify that you are using the latest version of iTunes before attempting to update.
         2. Connect your device to your computer.
         3. Select your iPhone, iPad, or iPod touch when it appears in iTunes under Devices.
         4. Select the Summary tab.
         5. Select the Restore option.
         6. When prompted to back up your settings before restoring, select the Back Up
             option (see in the image below). If you have just backed up the device, it is not
             necessary to create another.
         7. Select the Restore option when iTunes prompts you (as long as you've backed up,
             you should not have to worry about restoring your iOS device).
         8. When the restore process has completed, the device restarts and displays the Apple
             logo while starting up:
               After a restore, the iOS device displays the "Connect to iTunes" screen. For updating
              to iOS 5 or later, follow the steps in the iOS Setup Assistant. For earlier versions of
              iOS, keep your device connected until the "Connect to iTunes" screen goes away or
              you see "iPhone is activated."
         9. The final step is to restore your device from a previous backup. If you do not have a
              backup to restore, then restore as New.
    If you are restoring to fix a forgotten Restrictions Code or as a New device, then skip Step 9 and restore as New.

  • Help :how to remove spaces in string

    could any body please help me in removing spaces from string suppose i have written vivek chhabra and i want to remove spaces in this string and want a string vivekchhabra then how this could be done
    anybody help me please
    vivek

    String string = "Hello - This is a test!";
    String result = string.replaceAll(" ", "");
    System.out.println(result);This code results the following output:
    Hello-Thisisatest!

  • I have "@mail.ru" tool bar(i think) under the address bar. Its in a different language. I am not able to remove that. Please help me to remove that

    I have "@mail.ru" tool bar(i think) under the address bar. Its in a different language. I am not able to remove that. Please help me to remove that. Its not listed under 'Extensions', plug-ins,add-on too..
    Thanks

    Please look at another post I have just made relating to mail.ru, and post back with how you get on.
    * [/questions/924267#answer-323108] <-- clickable link -- (blue) --

  • I have unabled 5 fingure gesture now not able to perform any task,also my power button is not working,please help me in removing this gesture,using I phone 4

    I have unabled 5 fingure gesture now not able to perform any task,also my power button is not working,please help me in removing this gesture,using I phone 4

    I have unabled 5 fingure gesture now not able to perform any task,also my power button is not working,please help me in removing this gesture,using I phone 4

  • Hi, when ever I'm using 3G, on my Iphone4 sim stops working and Network is lost, this started after I updated my phone with  6.0.1(10A523)version. Please help how to solve this problem.

    Hi, when ever I'm using 3G, on my Iphone4 sim stops working and network is lost, this started after I updated my phone with  6.0.1(10A523)version. Please help how to solve this problem. Thanks.

    Photos/videos in the Camera Roll are not synced. Photos/videos in the Camera Roll are not touched with the iTunes sync process. Photos/videos in the Camera Roll can be imported by your computer which is not handled by iTunes. Most importing software includes an option to delete the photos/videos from the Camera Roll after the import process is complete. If is my understanding that some Windows import software supports importing photos from the Camera Roll, but not videos. Regardless, the import software should not delete the photos/videos from the Camera Roll unless you set the app to do so.
    Photos/videos in the Camera Roll are included with your iPhone's backup. If you synced your iPhone with iTunes before the videos on the Camera Roll went missing and you haven't synced your iPhone with iTunes since they went missing, you can try restoring the iPhone with iTunes from the iPhone's backup. Don't sync the iPhone with iTunes again and decline the prompt to update the iPhone's backup after selecting Restore.

  • How to remove duplicates in iphoto 7.1.5 and aperture 2.1.4 on same hard drive

    How to remove duplicates from iPhoto 7.1.5 and Aperture 2.1.4 on same hard drive?

    For iPhoto duplicate annihalitor is a good solution
    For Aperture it is best to ask in the aperture forum
    LN

  • After updating my Macbook Pro retina display to os x yosemite 10.10.2, the mause and track pad locks, and do not respond especially when using the Mac for a long period, please help, how can I solve this, I do not like feel like in windows, so I paid

    after updating my Macbook Pro retina display to os x yosemite 10.10.2, the mause and track pad locks, and do not respond especially when using the Mac for a long period, please help, how can I solve this, I do not like feel like in windows, so I paid good money for this mack, I feel calm

    Hi Buterem,
    I'm sorry to hear you are having issues with your MacBook Pro since your recent Yosemite update. I also apologize, I'm a bit unclear on the exact nature of the issue you are describing. If you are having intermittent but persistent responsiveness issues with your mouse or trackpad, you may want to try using Activity Monitor to see if these incidents correspond to occupied system resources, especially system memory or CPU. You may find the following article helpful:
    How to use Activity Monitor - Apple Support
    If the entire system hangs or locks up (for example, if the system clock freezes and stops counting up), you may also be experiencing some variety of Kernel Panic. If that is the case, you may also find this article useful:
    OS X: When your computer spontaneously restarts or displays "Your computer restarted because of a problem." - Apple Support
    Regards,
    - Brenden

Maybe you are looking for