Looping over query by month

etings,
I have a query I am pulling that has a date field entitled, "Completed". I am attempting to loop over the query by date to slice and dice the data for a table and chart. Here is what I have done thus far...
Setup two variables where I am only interested in the month. My plan is to fileter the date by month so I can pull the data out by month.
    <cfset startDate = #DatePart('m','01/01/09')#>
    <cfset endDate = #DatePart('m',Now())#>
Here is my loop...
    <cfloop from = "#startDate#" to = "#endDate#" index = "i" step = "1">
Here is one of my QoQs within the loop...
        <cfquery name="NPS0" dbtype="query">
        SELECT *
        FROM rsNPS
        WHERE #DatePart('m',rsNPS.completed)# = #i#
        </cfquery>
I am having difficulties in getting this to work. Has anyone ever done something like this. I feel like the answer is right in front of me, but I have been staring at this code for a while. If anyone has any thoughts, I would be glad to hear them.
~Clay

fs22 wrote:
         <cfquery name="NPS0" dbtype="query">
        SELECT *
        FROM rsNPS
        WHERE #DatePart('m',rsNPS.completed)# = #i#
        </cfquery>
QoQ are a separate beast. You cannot use standard CF functions inside them.  AFAIK, QoQ only support a few functions like CAST, UPPER, LOWER, etcetera.  So as Dan suggested, you should peform the date functions in your database query.

Similar Messages

  • Why optimizer prefers nested loop over hash join?

    What do I look for if I want to find out why the server prefers a nested loop over hash join?
    The server is 10.2.0.4.0.
    The query is:
    SELECT p.*
        FROM t1 p, t2 d
        WHERE d.emplid = p.id_psoft
          AND p.flag_processed = 'N'
          AND p.desc_pool = :b1
          AND NOT d.name LIKE '%DUPLICATE%'
          AND ROWNUM < 2tkprof output is:
    Production
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.00          0          0          4           0
    Execute      1      0.00       0.01          0          4          0           0
    Fetch        1    228.83     223.48          0    4264533          0           1
    total        3    228.84     223.50          0    4264537          4           1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 108  (SANJEEV)
    Rows     Row Source Operation
          1  COUNT STOPKEY (cr=4264533 pr=0 pw=0 time=223484076 us)
          1   NESTED LOOPS  (cr=4264533 pr=0 pw=0 time=223484031 us)
      10401    TABLE ACCESS FULL T1 (cr=192 pr=0 pw=0 time=228969 us)
          1    TABLE ACCESS FULL T2 (cr=4264341 pr=0 pw=0 time=223182508 us)Development
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.00          0          0          0           0
    Execute      1      0.00       0.01          0          4          0           0
    Fetch        1      0.05       0.03          0        512          0           1
    total        3      0.06       0.06          0        516          0           1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 113  (SANJEEV)
    Rows     Row Source Operation
          1  COUNT STOPKEY (cr=512 pr=0 pw=0 time=38876 us)
          1   HASH JOIN  (cr=512 pr=0 pw=0 time=38846 us)
         51    TABLE ACCESS FULL T2 (cr=492 pr=0 pw=0 time=30230 us)
        861    TABLE ACCESS FULL T1 (cr=20 pr=0 pw=0 time=2746 us)

    sanjeevchauhan wrote:
    What do I look for if I want to find out why the server prefers a nested loop over hash join?
    The server is 10.2.0.4.0.
    The query is:
    SELECT p.*
    FROM t1 p, t2 d
    WHERE d.emplid = p.id_psoft
    AND p.flag_processed = 'N'
    AND p.desc_pool = :b1
    AND NOT d.name LIKE '%DUPLICATE%'
    AND ROWNUM < 2
    You've got already some suggestions, but the most straightforward way is to run the unhinted statement in both environments and then force the join and access methods you would like to see using hints, in your case probably "USE_HASH(P D)" in your production environment and "FULL(P) FULL(D) USE_NL(P D)" in your development environment should be sufficient to see the costs and estimates returned by the optimizer when using the alternate access and join patterns.
    This give you a first indication why the optimizer thinks that the chosen access path seems to be cheaper than the obviously less efficient plan selected in production.
    As already mentioned by Hemant using bind variables complicates things a bit since EXPLAIN PLAN is not reliable due to bind variable peeking performed when executing the statement, but not when explaining.
    Since you're already on 10g you can get the actual execution plan used for all four variants using DBMS_XPLAN.DISPLAY_CURSOR which tells you more than the TKPROF output in the "Row Source Operation" section regarding the estimates and costs assigned.
    Of course the result of your whole exercise might be highly dependent on the actual bind variable value used.
    By the way, your statement is questionable in principle since you're querying for the first row of an indeterministic result set. It's not deterministic since you've defined no particular order so depending on the way Oracle executes the statement and the physical storage of your data this query might return different results on different runs.
    This is either an indication of a bad design (If the query is supposed to return exactly one row then you don't need the ROWNUM restriction) or an incorrect attempt of a Top 1 query which requires you to specify somehow an order, either by adding a ORDER BY to the statement and wrapping it into an inline view, or e.g. using some analytic functions that allow you specify a RANK by a defined ORDER.
    This is an example of how a deterministic Top N query could look like:
    SELECT
    FROM
    SELECT p.*
        FROM t1 p, t2 d
        WHERE d.emplid = p.id_psoft
          AND p.flag_processed = 'N'
          AND p.desc_pool = :b1
          AND NOT d.name LIKE '%DUPLICATE%'
    ORDER BY <order_criteria>
    WHERE ROWNUM <= 1;Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Looping over QoQ Where Clause

    I have two queries. One is a main query that we pull from a form submission. The second is a small query resultset that lists different subgroups in my company and what main group they belong to. I pull several QoQ from the main query. In the main query results, there is a column that holds the subgroup information. I am trying to do a Q0Q where I group the data from the main query into the main groups for analysis. Here is an example...
    Main Query
    record 1 - subgroup 1
    record 2 - subgroup 2
    record 3 - subgroup 3
    Second Query
    Subgroup 1 - Main Group 1
    Subgroup 2 - Main Group 2
    Subgroup 3 - Main Group 1
    So I am trying to loop over a QoQ on the main query where the result set would contain the information only from Main Group 1. So record 2 would be eliminated. I have tried using an IN clause with a cfloop, but I run into syntax trouble with the comma. I also tried looping over the QoQ as a whole and the resulting dump is only the last record.
    If there is anything else you need, let me know.
    Any thoughts?
    Clay
    P.S. Here is a code sampling...
        <cfquery name="rsGroup" datasource="nps">
        SELECT *
        FROM "GROUP"
        WHERE GROUP.PrimaryGroup = '#form.primarygroup#'
        </cfquery>
        rsGroup - <cfdump var="#rsGroup#">
        <cfloop query="rsGroup" startrow="1" endrow="#rsGroup.RecordCount#">
            <cfquery name="rsGroupQoQ" dbtype="query">
            SELECT *
            FROM rsNPS
            WHERE rsNPS.grp = '#rsGroup.group#'
            </cfquery>
        </cfloop>
        rsGroupQoQ - <cfdump var="#rsGroupQoQ#"><cfabort>

    ok...I figured it out. I thought I would post my solution in case anyone else runs into this. Also, if anyone out there has a better way, let me know.
    <!---Dummy array to house 'blank' value for adding of column to main query--->
    <cfset GroupArray = ArrayNew(1)>
    <!---Variable that adds mainGroup column to main query with blank data from dummy array--->
    <cfset addMainGroup = QueryAddColumn(rsNPS,'mainGroup',GroupArray)>
    <!---Loop that sets value on added mainGroup column based off of main query grp column value--->
    <cfloop query="rsNPS" startrow="1" endrow="#rsNPS.RecordCount#">
        <cfif rsNPS.GRP EQ "xxxxx"><cfset rsNPS.mainGroup = "yyyyy"></cfif>
        <cfif rsNPS.GRP EQ "xxxxxxxxxx"><cfset rsNPS.mainGroup = "yyyyyyyyyy"></cfif>
        <cfif ...etc. ...
    </cfloop>

  • Looping over Nested Structure

    Hey Guys,
    I have a component that returns a structure. The structure is
    called ContactQuery. ContactQuery has to elements, one called
    Results, and one called Success. Results contains the data I want
    to loop over. If you try looping over the ContactQuery by using
    CFLoop and specify the ContactQuery as the collection, of course it
    only loops twice (once for Results, once for Success). How can I
    loop over the Results structure withing ContactQuery? You can see
    the dump of the structure at:
    http://www.digitalswordsmen.com/cfschedule/admin/Create_Tokens_Table.cfm
    Attached is the code I have. I am just unsure of the syntax
    for looping over the Results section of the structure.
    Thank you.

    Nope. I am dumb and didn't really think about it. The fact
    that it is a query nested in a structure threw me off. The code
    that works was
    <cfloop query="ContactQuery.Results">
    <tr>
    <td></td><td>#firstname#</td><td>#lastname#</td><td>#email#</td><td>#randrange(10000,9999 9)#</td>
    </tr>
    </cfloop>
    Thanks for the help, sorry about that dumb question.

  • Looping over cfdirectory

    Hello. I am having an issue with looping over cfdirectory.
    What I am trying to do here is grab the size of the files
    associated with the db. So where #current.Dir.Name# = #DB Column#
    update size etc.... What's happening is it is displaying the same
    id about 90 something times...Nice I know. Can anyone help?
    <cfloop query="qLoadFile">
    <cfoutput>
    <cfdirectory
    directory="/test1/test2/test3/0/#qLoadFile.owner_id#" action="list"
    name="currentDir">
    #qLoadFile.owner_id# <!--- This does display my ids
    correctly if I end the loop here but does not display anything in
    my table if I end the loop here and reopen it--->
    </cfoutput>
    <table border="1" bordercolor="#000000" >
    <tr>
    <td>File Name</td>
    <td>File Size</td>
    <td>Directory Location</td>
    <td>File Type</td>
    </tr>
    <cfloop query="currentDir">
    <tr>
    <cfoutput>
    <form name="updateSize" action="
    http://myURL.com/test2.cfm"
    method="post">
    <td><input type="text" name="name"
    value="#currentDir.Name#" /></td>
    <td><input type="text" name="size"
    value="#currentDir.Size#" /></td>
    <td>#right(currentDir.DIRECTORY, 2)#</td>
    <td>#currentDir.Type#</td>
    </cfoutput>
    </tr>
    </cfloop>
    </cfloop>
    </table> <br />
    <input type="text" name="number_of_directories"
    value="<cfoutput>#valuelist(qLoadFile.owner_id)#</cfoutput>">
    <input type="submit" name="submit" value="submit"/>
    </form>

    I just put your query into a random page of mine, changed the
    query to reflect a local database and got this output (all
    formatted correctly though!)
    Since I dont have the directory setup that you have the
    directory structures are empty, however it seems to be looping
    through fine
    59 File Name File Size Directory Location File Type
    60 File Name File Size Directory Location File Type
    61 File Name File Size Directory Location File Type
    62 File Name File Size Directory Location File Type
    63 File Name File Size Directory Location File Type
    64 File Name File Size Directory Location File Type
    65 File Name File Size Directory Location File Type
    Is this what you are looking for?

  • Looping over a structure of arrays

    Hi Guys, I am trying to loop over a structure of simple
    arrays. The structure's second column contains a 1 dimentional
    array.
    I can't seem to get the proper syntax for my loop.

    I want to be able to dynamically loop over my query and
    decrypt it as I pass it into my structure. I have figured the code
    out to loop over the query and pass it to the structure. My problem
    now is whn I go to decrypt it I get this Error.
    There has been an error while trying to encrypt or decrypt
    your input string: Input length (with padding) not multiple of 16
    bytes.
    How can I fix this?
    Here is my code could it be because my varchar columns were
    not long enough. Here is my code.

  • Looping over a structure

    How do I loop over this structure to populate it with a Query
    Recordset?
    <cfset myStruct =
    objImage.getSize("images/products/largeImages/#Recordset1.elink#")>
    I really appreciate your help.

    I would like to populate the structure with the image file
    names that are coming from the query. The structure is built from a
    java object. Here is the function to create it.
    <cfcomponent>
    <cffunction name="getSize" returntype="struct"
    access="public" output="No">
    <cfargument name="Image" required="Yes" type="string">
    <cfset myImage = createObject("java",
    "javax.swing.ImageIcon")>
    <cfset myImage.init(expandpath(arguments.Image))>
    <cfset myStruct = StructNew()>
    <cfset myStruct.width = myImage.getIconWidth()>
    <cfset myStruct.height = myImage.getIconHeight()>
    <cfreturn myStruct>
    </cffunction>
    </cfcomponent>
    <cfobject component="imageSize" name="objImage">
    <cfset myStruct =
    objImage.getSize("/images/someimage.jpg")>
    <cfoutput>
    width: #myStruct.width#
    height: #myStruct.height#
    </cfoutput>
    Right now the structure only gives me the first row of the
    query. I have tried using the cfquery loop to populate the
    structure with now results. I suspect I am using the wrong
    syntac.

  • Loop over characters and numbers?

    Hi,
    I am working with a list of school grades.
    I have a query that returns a start value and and end value.
    Sometimes it may return, start_grade of 2 and end_grade of 5. I
    then loop over this using
    <cfloop from="#variables.start_grade#"
    to="#variables.end_grade#" index"i">
    </cfloop>
    The problem is sometimes "start_grade" is "P" for Preschool
    and "end_grade" is 8 for Eighth grade. I am wondering how I can
    loop over the grades in that scenario. It works fine when the grade
    is numeric, but when its a P or a K it does not work.
    Any help appreciated.
    -Westside

    I thought of that, but did not think -1 would be treated
    numerically for some reason. If that works, then my loop will be
    fine, but my display will not. When I want to output the grade, I
    will get a 0 or -1 as opposed to the user visually seeing P and a K
    So if I have a range of P - 4 for example
    I want to see in the display even though we have set them to
    0 and -1
    P, 1, 2, 3, 4
    If I do the conversion, when I am looping , I will lose the
    character representations that I need to display visually
    Any help apreciated.
    -Westside

  • Loop over datasets

    SQL Server 2008 with latest service packs and patches as of 1/1/2015.
    I have 15 datasets in my SSRS report.  Each dataset has the exact same columns (Code, Name, Length).  The query behind each dataset is pretty much the same just differences (sometimes vast differences) in the WHERE clause.
    Do I have to drag and drop a tablix onto the screen for each dataset or can I programmatically create tablix by looping over the available datasets?  The number of datasets may change but the three output columns will always be the same.
    Thank you in advanced for your help.
    JamesNT
    "If you have to ask about various operating system limits, you're probably doing something wrong." -Raymond Chen

    You can merge them all to single dataset and then add a filter column to filter the individual datasets to individual containers.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • I have the latest version of Abode Reader. However, over the past month or so, my Reader has constan

    I have the latest version of Adobe Acrobat Reader. I operate on Windows 7 with Outlook as my e-mail filter. However, over the past month or so, my Reader has constantly become "not responding" whenever I open-up a pdf file that was attached to an e-mail. When trying to read the pdf file, it doesn't allow me to scroll through the document and then goes into "not responding" mode which forces me to exist and then re-open the file many times until I have been able to read the documents. This "not responding" shut down to the pdf file is constant and very annoying. What is going on and how can I fix it?
         THanks,

    Thank you for your kind and thoughtful input.
    My Adobe reader is the most current one that's out there per Adobe.
    Something like XII  or higher.
    As for my Outlook, it's MS Outlook 2003, and I believe it's Express Outlook.
    If I disable the Protected Mode, per your suggestion, maybe that will work.
    I'll try it.
    Thanks again, and if you have any other ideas, I would appreciate your
    thoughts.
    Thank you.
    Joel

  • How can i loop over treeview selected nodes and then to delete each node if it's a directory or a file ?

    I have this code:
    if (s == "file")
    file = false;
    for (int i = 0; i < treeViewMS1.SelectedNodes.Count; i++)
    DeleteFile(treeViewMS1.SelectedNode.FullPath, file);
    I know it's a file and it is working if it's a single file.
    On the treeView i click on a file right click in the menu i select delete and it's doing the line:
    DeleteFile(treeViewMS1.SelectedNode.FullPath, file);
    And it's working no problems.
    But i want to do that if i selected some files togeather multiple selection then to delete each file.
    So i added the FOR loop but then how do i delete from the SelectedNodes each node ?
    The treeView SelectedNodes dosen't have FullPath like SelectedNode also doing SelectedNodes[i] dosen't have the FullPath property.
    Same as for if i want to delete a single directory or multiple selected directories:
    This is the continue of the code if it"s not a "file" (else) it's null i know it's a directory and doing:
    else
    file = true;
    RemoveDirectoriesRecursive(treeViewMS1.SelectedNode, treeViewMS1.SelectedNode.FullPath);
    Also here i'm using SelectedNode but if i marked multiple directories then i how do i loop over the SelectedNodes and send each SelectedNode to the RemoveDirectoriesRecrusive method ?
    My problem is how to loop over SelectedNode(multiple selection of files/directories) and send each selected file/directory to it's method like i'm doing now ?

    foreach (TreeNode n in treeViewMS1.SelectedNodes)
    // Remove everything associated with TreeNode n here
    I don't think it's any harder than that, is it?
    If you can multi-select both an item and one of its descendents in the tree, then you'll have the situation that you may have deleted the parent folder and all of its children by the time you get around to deleting the descendent.  But that's not such
    a big deal.  A file can get deleted externally to your program too - so you'll just have to deal with it having been deleted already (or externally) when you get around to deleting it yourself.

  • [Solved] Foreach loop that loops over all files in a folder does not consider first file found

    Hello,
    I have a foreach loop in SSIS (as part of Visual Studio 10 and with SQL Server 2012).
    It loops over all files in a folder (ForEach File Enumerator).
    I set the folder: OK
    Traverse Sub folders: OK
    I have set up a Variable in Variable Mappings called FileName so it shows User::FileName: OK
    Index of variable is 0: OK
    It almost works ok. Except that the first file it finds is never considered.
    I set a breakpoint then and the first file it finds, is shown in black in the watch variable window. All subsequent files found are shown in red font. When I change the names of the files so another file is the first file found then it skips the other one
    which now is the first file.
    What is going on here? Why does SSIS skip the first file it finds in a foreach file loop?
    Any suggestions highly appreciated.
    Thank you
    Andi
    Andreas

    "red font - interesting, any example to show us (image)
    It would be interesting to share with us whether you use any file masks or expressions.
    Arthur
    MyBlog
    Twitter
    It appears a variable value turns red when it changes between breakpoints. It started black for the first value (the first file, obtained BEFORE the execution reached the breakpoint), and then turned red. I was able to reproduce this behavior on a test environment.
    However, it did not skip any files.
    OP, please set up the test shown in the image below. Create a breakpoint in the sequence container for the "OnPreExecute" event.

  • Why are we paying over $300 a month for a family plan that doesn't include call blocking or decent voicemail services?

    I am a member of a shared family plan which as I see it posted our bill is over $300 a month, which does not include unlimited data, family protection (which allows you to permanently block numbers vs there 30 or 90 day limit if you are not covered) <---- this requires you to constantly be on alert of something so ridiculous that it shouldn't be concerned with, and finally they do not offer an upgraded voicemail service.  So my voicemail asks me to enter pin than right to messages.  It does not tell me the following:  The date the call was made, the time the call was made, nor any other pertinent information regarding the call aside from the number and than the message.  It's frustrating because I miss a lot of calls these days due to volume controls and silent modes and ring tones that aren't loud enough that I need to know when calls are received.  I don't ever remember having to pay for an upgraded voicemail service, that's like hiring a firm to handle all my incoming calls.  I want my answering machine back.  I have many other issues to include Verizon's online chat service which has at least one major issue.  I won't bring that up here.  The question is how much more money can they get for a simple cell phone plan?  For christ's sake.
    Message was edited by: NoMoreOriginalNames Grammar corrections

    The free voicemail is basic which gives you the date and time of the message. If you want more you should pay for more. Also, some Android phones with KitKat have free Visual Voicemail.
    Thank you for your feedback, but my phone gives me no choice and it most certainly does not state the date and time that the message was received.  The only way for me to know that is if I happen to check exactly the phone log around the same time that the message was left, else it is buried underneath other more recent and answered calls.  And seriously man, the whole pay more idea is getting a bit far-fetched.  There is no reason why I should be able to buy a portable mini answering machine for a one time payment of $14.99 with a reusable blank tape, they don't have these and we'd look ridiculous carrying them around with everything else, but the point is we are giving permission to charge for some ridiculous things that should not be paid more for.  My old answering machine worked just fine, and more importantly I have never paid for an "upgraded" voicemail service.  As I mentioned if I want that I can hire a service to do that, but I don't need that.  I hope you can understand my growing concerns.  We pay for every little in-app purchase, we are being programmed to pay for everything that should already be includedfdasf in an initial price, brought home and enjoyed for its duration.  Instead wesdfsdf are paying monthly fees and dues on objects that aren't covered by warranties or insurances which eventually break and leave people struggling to pick up the pieces.  These are serious issues because people now rely so much on their phones (of course this is all my opinion) that we've become depandent on them.  Anyway, thanks, appreciate all the feedback. 
    As for blocking this is what it states on my plan under the blocking feature tab:
    You can block calls and message from up to 5 phone numbers at no charge. 
    Expiration. Blocks expire after 90 days. Be sure to reapply the block if you wish to continue the service restriction. To permanently block numbers, subscribe to FamilyBase*.
    Limitations.
    You cannot block numbers within your account or non-10 digit numbers such as 911,411 or #MIN (checks minutes used).
    Apple® iMessage® won't be blocked. Messages from this service can be blocked by disabling the iMessage feature from within the Settings>Messages menu of your Apple device.
    Unblocking. To unblock a number, highlight and delete the number, then click "Submit".
    So there's the limits, but even worst is they don't include a simple field where I can put the name of the individual I am blocking.  So when it comes time to maybe rotate one out (this should be an unlimited number), one of the many 5 I can choose to block, I might not remember who is who or what is what.  I have a lot of responsibilities in my life, this is not one that should be pushed on the consumer.  It's ridiculous.

  • Problem with Message-Mapping: Loop over Elements possible?

    Hi all,
    I want do create a Message-Mapping for an IDoc-to-File Scenario. In the Source Structure there are some Elements which can appear more than once (1..unbounded). I need a mechanism which loops over these elements and search for specified values. From the Element which contains an element with this specified value the mapping should write a value in the target structure.
    Here a simple example (source structure) for better understanding:
    <root>
       <invoice>
          <number> 10 </number>
          <sum> 200.00 </sum>
       </invoice>
       <invoice>
          <number> 20 </number>
          <sum> 150.00 </sum>
       </invoice>
       <invoice>
          <number> 30 </number>
          <sum> 120.00 </sum>
       </invoice>
    </root>
    Now the duty of the Mapping should be to search in the elements <invoice> for the number 30. And then the sum of the invoice with the number 30 should be written in a field of the target structure.
    I tried it out with a constant togehter with an equalsS-function and an ifWithoutElse-function, but it is working only then, if the invoice with the number 30 has the first position in the root context.
    Can anybody help me? Thanks
    With kind regards
    Christopher

    Hi,
    Write a UDF to sum the required values and map to target node.
    See while writing the UDF select the type as queue.
    number -- removecontext-UDF targetnode
    sum----removecontext--/
    number abd sum or the two inputs
    in UDF
    int nsum = 0;
    for(int i;i < number.length;i++){
      if number(i).equals("30") then
         nsum = nsum + valueOf(sum(i));
    result.addValue(nsum); // convert the nsum into string
    Regsrds
    Chilla

  • Message-Mapping: nested Loops over Elements

    Hi Experts,
    I have problems with my Message-Mapping in the IR. I have a source and a target structure. In the following I will give you easy examples of these structures:
    <u>source structure:</u>
       <E1EDP01>
          <E1EDP19>
             <QUALF> ... </QUALF>
             <IDTNR> ... </IDTNR>
          </E1EDP19>
          <E1EDP19>
             <QUALF> ... </QUALF>
             <IDTNR> ... </IDTNR>
          </E1EDP19>
       </E1EDP01>
       <E1EDP01>
          <E1EDP19>
             <QUALF> ... </QUALF>
             <IDTNR> ... </IDTNR>
          </E1EDP19>
          <E1EDP19>
             <QUALF> ... </QUALF>
             <IDTNR> ... </IDTNR>
          </E1EDP19>
       </E1EDP01>
    <u>target structure:</u>
    <LineItem>
       <IDTNR></IDTNR>
    </LineItem>
    <LineItem>
       <IDTNR></IDTNR>
    </LineItem>
    That means:
    For every <E1EDP01> in the source structure I create one <LineItem> in the target structure. One E1EDP01-Element can contain more than one E1EDP19-Elements. I have to loop over these E1EDP19-Elements, because I have to locate the Element <QUALF> with a given (fixed) value. The Mapping should put the value from the Element <IDTNR> from the source structure - where the QUALF-Element has this given value - in the IDTNR-Element of the target structure.
    I tried it with a UDF, but only the first <IDTNR> in the target structure got filled.
    Thanks for your help
    Christopher

    Thank you,
    but how I can set the Elements IDTNR and QUALF to the context E1EDP01?
    In the splitByValue-Function do I need "each value"?
    best regards
    Christopher

Maybe you are looking for