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 / May 2006

Tip: Looking for answers? Try searching our database.

Help with XPATH

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shaun - 05 May 2006 21:56 GMT
Hi,

Sorry for as many questions in days. I need a way to count the total number
of rows with a unique attribute. I have been working at it for some time and
have came up with a rather ugly XPATH statement. I think it should work but
it is not counting the number of unique rows, instead it gives the same
answer as if i just took at the preceding-sibling path. Any clues?

Shaun

===

count(
../../dfs:dataFields/d:comSystemList/d:radioVeh/d:deficencyVeh/@defVehRad[
not(. =
preceding-sibling::dfs:dataFields/d:comSystemList/d:radioVeh/d:deficencyVeh/@defVehRad)

and

(../../d:Vehicles/@BN_ID = ../../../../../my:Stats/my:BN and
../../d:Vehicles/@CO_ID = ../../../../../my:Stats/my:CO)

])
Greg Collins [InfoPath MVP] - 05 May 2006 23:35 GMT
You are prefixing the root node with 'preceding-sibling'. That won't work because the node you are trying to compare is d:deficiencyVeh.

Try something like:

count(../../dfs:dataFields/d:comSystemList/d:radioVeh/d:deficencyVeh[not(@defVehRad = preceding-sibling::d:deficencyVeh/@defVehRad)])

Signature

Greg Collins [InfoPath MVP]
Visit Brain Trove ( http://www.BrainTrove.com )
Visit InfoPath Dev ( http://www.InfoPathDev.com )

Shaun - 06 May 2006 00:31 GMT
wow, thanks!

I'm making a lot more progress after about a week of learning. I keep
wanting to throw sql statements at the thing until I realize it's just a
different way of looking at the problem.

Shaun

> You are prefixing the root node with 'preceding-sibling'. That won't work because the node you are trying to compare is d:deficiencyVeh.
>
> Try something like:
>
> count(../../dfs:dataFields/d:comSystemList/d:radioVeh/d:deficencyVeh[not(@defVehRad = preceding-sibling::d:deficencyVeh/@defVehRad)])
 
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.