Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / April 2005

Tip: Looking for answers? Try searching our database.

Filter data on repeating table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mcchu - 04 Apr 2005 23:29 GMT
Hello,

I like to filter data on a repeating table using the Filter Data feature of
the control.

I want to only show rows that are filtered based on only unique field
values.  For example, I have the following schema:

myRow
 Key
 value

Sample data:
key     value
1        10
1        20
2        30
2        40
3        50

I only want to see the following rows in the table:
Sample data Filtered:
key     value
1        10
2        30
3        50

Pretty much I only need it to show first row.  I try the following filter
expression on myRow, but it did not work.  Please let me know what I am doing
wrong.

key = not(key = ../preceding::myRow/key)

Thank you,
Michael
mcchu - 05 Apr 2005 16:11 GMT
Hi,

I figured out my problem... My Xpath for preceding is one node too far since
the context node is already at the myRow.  The solution should be as follows:

key = not(key = preceding::myRow/key)

Now I have another problem.  I have two keys now instead of one.  I want to
be able to filter rows based on these two keys which are unique.

For example, I have the following schema:

myRow
 Key1
 Key2
 value

Sample data:
key1   key2     value
1        a         10
1        a         20
1        b         30
1        b         40
2        a         10
2        a         20
2        b         30
2        b         40
3        a         10

I only want to see the following rows in the table:
Sample data Filtered:
key1   key2     value
1        a         10
1        b         30
2        a         10
2        b         30
3        a         10

I have tried with the following filter expression(but it doesn't work fully):

key1 = not((key1= preceding::myRow/key1) and (key2= preceding::myRow/key2))

Results...
key1   key2     value
1        a         10
1        b         30
2        a         10
2        b         30  (missing this row.. I know why.. coz 2 happens before
and b as well)
3        a         10

> Hello,
>
[quoted text clipped - 31 lines]
> Thank you,
> Michael
mcchu - 07 Apr 2005 18:05 GMT
Hi,

Can someone please comment on the previous message on the Xpath expression
which I can use to filter duplicate records based on two unique keys?

The problem is that the current() function will not work when Filter Data is
used here because there is no current context node.  However, it seems like
one can make use of the context node when using the child element not inside
a predicate expression.

I have tried many expressions.  In most cases, it comes close to what I want
but not fully.

Regards,
Michael

> Hi,
>
[quoted text clipped - 82 lines]
> > Thank you,
> > Michael
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.