Help for Xpath Formulas - InfoPath Dev
in

InfoPath Dev

Help for Xpath Formulas

Last post 09-01-2013 04:00 PM by Patrick Halstead. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 08-22-2013 02:41 AM

    • Ghaith
    • Not Ranked
    • Joined on 08-22-2013
    • Posts 2

    Help for Xpath Formulas

     

    Hi All ,

    I need your help please as I want to Set Target Formulas for Conflicted sheet

    I made list in Share point included the main target for each location then i connected with Staff target as each employee has individual target

    then i tried to make the Formulas for staff target as below

    if the Target for Column = Supervisor then get IPhone

    if the Target for Column = Agent then count Agent in Location and div. the I phon

    the Formulas i has made it as below but it is need to correct

     

    Iphon / sum((Target for=Agent)) or sum((Target for=Supervisore) 

     

    Location  Name in English  Target for I Phoen  Blackberry  Nokia 
    FOD-1 Different Name Supervisore      
    FOD-1 Different Name Agent      
    FOD-1 Different Name Agent      
    FOD-1 Different Name Agent      
    FOD-1 Different Name Agent      
    FOD-1 Different Name Agent      
    FOD-1 Different Name Agent      
    FOD-1 Different Name Agent      
    FOD-2 Different Name Supervisore      
    FOD-2 Different Name Agent      
    FOD-2 Different Name Agent      
    FOD-2 Different Name Agent      
    FOD-2 Different Name Agent      
    FOD-2 Different Name Agent      
  • 08-24-2013 06:38 PM In reply to

    Re: Help for Xpath Formulas

    Hi Ghaith and welcome,

    You seem very close to a solution. Assuming you have a query that loads all of the data from this list (when the form opens or on some buttom click), you'll want to have two rules - one for supervisor and another for agent. If the supervisor opens the form (use a field with a condition) then your supervisor rule will set a value equal to the sum with a filter where "Target for equals 'supervisore'". For agents, if you need to divide by the number of rows for that agent, you can use the count() xpath function with a filter for the rows equal to that agents Name in English, or just "Target for equals 'Agent'" if it's for all agents.

    Good luck!

    Patrick Halstead
    Project Manager at Qdabra
  • 08-25-2013 10:01 PM In reply to

    • Ghaith
    • Not Ranked
    • Joined on 08-22-2013
    • Posts 2

    Re: Help for Xpath Formulas

    Thank You very Much for your Help , I did it and it working fin but what about counting for Number of Agent in each location" First Culomn in above table "

    Thanks Again

  • 09-01-2013 04:00 PM In reply to

    Re: Help for Xpath Formulas

    Just add a filter. count(agent[loc='location1']) will give you the count of all agent fields where loc is equal to location1. Substitute your own fields and give it a try or use InfoPath filter dialog to have it create the xpath for you.

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.