filtering for unique values - InfoPath Dev
in

InfoPath Dev

filtering for unique values

Last post 06-08-2006 07:36 AM by nhshelp. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 06-05-2006 04:26 AM

    filtering for unique values

    Hello,

    I'm having a real problem andhope some-one can help. I've had a look through the forums and how to pages, and tried some of th eoptons, but can't seem to fix my problem.

    Anyway here it is.

    I'm creating a form that allows people to submit information to create an account.
    I have an Access database called 'wgTest2' which has entries under the following
    Area, Site,Team, Name, signatory and e-mail.

    each of these is populated with information - some of it is duplicated.
    I have created drop down boxes for each data source so that I can pull the information off the database - this works fine!
    I have created a filter, so that if I choose an Area, I can see the sites that relate to that area. This also works fine!
    My problem is that there are duplicate entries, so I f I choose an Area, I see duplicate entries in the Site field.
    I have tried creating a Uniqueness filter, using the following expression
    not(.=..preceding-sibling::d:wgTest2/@Area) - This works fine for the Area entries - no duplicates displayed.
    However when I try to expand the filter I can't get tit to work.
    I've used the following expression on the Site data

    not(.=../preceding-sibling::d:wgTest2[@Area=current()/my:wgdata2/my:Area]/@Site)

    However it doesn't filter out the duplicates, I can still see them.

    Any ideas?????

    thanks!




  • 06-07-2006 12:56 AM In reply to

    Re: filtering for unique values

    Hello,
    Welcome to Forums. Did you add filter to site drop down so that the options in the Site drop-down list are filtered based on the selected Area.
    In order to filter the Site drop-down list based on the selected Area follow this steps:

    1. Click Filter Data for site dropdown, and then click Add.
    2. In the Specify Filter Conditions dialog box, select Select A Field Or Group from the first drop-down list.
    3. In the Select A Field Or Group dialog box, select site, and then click OK.
    4. In the second drop-down list, select Is Equal To.
    5. In the third drop-down list box, select Select A Field Or Group.
    6. In the Select A Field Or Group dialog box, select Main from the Data Source drop-down list, select site, and then click OK.
    7. Click OK four times to close all open dialog boxes.

    Hope this helps!
  • 06-07-2006 02:29 AM In reply to

    Re: filtering for unique values

    Hi,

    thanks for that - I have set up the filters already as you have suggested - these work fine. The problem is with duplicate entries appearing. For instance when I select the Area, it gives me the relevant site, but there are duplicate entries, so I can see Site A twice, site b three times etc.
    I have used the guide from here

    http://www.infopathdev.com/howto/tutorials/default.aspx?i=4e038a7f3f5b443bbe4db49f86d95fba

    and used the instructions for FILTERING LISTS FOR UNIQUE VALUES however I cant get the code to work

    have tried creating a Uniqueness filter, using the following expression
    not(.=..preceding-sibling::d:wgTest2/@Area) - This works fine for the Area entries - no duplicates displayed.
    However when I try to expand the filter I can't get tit to work.
    I've used the following expression on the Site data

    not(.=../preceding-sibling::d:wgTest2[@Area=current()/my:wgdata2/my:Area]/@Site)


    Thanks again for you r help

  • 06-07-2006 04:41 AM In reply to

    Re: filtering for unique values

    Hello,
    Did you differentiate fields in Main Datasource to fields in Secondary Datasource as in How To? I mean fields in Main Datasource are started with Capital letter where as fields in Secondary Datasource are started with Small letter. If you have differentiated in the same way then formula
    not(.=../preceding-sibling::d:wgTest2[@Area=current()/my:wgdata2/my:Area]/@Site) should be changed to
    not(.=../preceding-sibling::d:wgTest2[@Area=current()/my:wgdata2/my:Area]/@site)

    Hope this helps!
  • 06-08-2006 07:36 AM In reply to

    Re: filtering for unique values

    Thanks for yuo rhelp. I've managed to get this to work now - looks like I had an extra erroneous entry in my formula!!! Ooooppps. must remember- keep eyes open.

    Anyway thanks for your time and efforts! Much appreciated
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.