Problem mapping a same field to a field in duplicated segment

Hello,
I have a problem with my mapping. I'm trying to map a MATMAS.MATMA05 to another MATMAS.MATMAS05 iDoc. The mapping for the other fields is ok except for the LTKZA.
The idea is to duplicate the E1MLGNM segment in the target IDOC. Then I would like to have the LTKZA field for each segment mapped to the STOFF field(wich only appears once in the origin segment), with a small function that checks the value of the STOFF.
My problem is that the LTKZA in the first E1MLGNM segment is populated with the right value, but the one in the second segment is not populated.
Could anyone help with this issue? Do u think I can save the value of STOFF in variable, so that I can use it later?
Thank you all for your help.

Thank you Gordon,
I combined the copyPerValue function and the SplitByValue and it worked fine.
Sorry again to post the thread in the wrong forum.
Regards,
Natacha

Similar Messages

  • Problem with displaying same field in three columns

    Hi
    I am using reports developer 11g and I have created a report which displays only one field (column), which is id_number as output but I have a problem now.
    I would like to display the id_number in three columns on one page to save paper, that is, I want to show the first 20 (1 - 20) id_numbers in one column going down, then display the next 20 id_numbers (21 - 40) on the second column on the same page and the next 20 (41 - 60) on the third column still on the same page. If there are more than 60 id_numbers, they should be printed on the next page again in three columns, and so on until all the id_numbers are displayed. How can I achieve this? Could you please assist me?
    Thanks.

    Andreas, I think I am missing something here. I have done what you have said but still the id_numbers are all being displayed
    in the first column and jumps on to the next page without displaying the id_numbers across the page in columns.
    My data model contains a group with not only the id_number but has other fields which I am not displaying.
    I am only using the other fields just to use them in conditions to select only id_numbers which meet a certain criteria which I then display in the report.
    I have created a repeating frame for that group and changed the orientation property to Down/Across. Within that frame, I have a field for the id_number
    which I want displayed in three columns, running across the page as I have already told you. Please help.
    Thanks.

  • Issue in mapping the same source and target fields

    Hi All,
    I am working on PI 7.0 and currently I am connecting to PI 7.0 via citrix desktop . Problem here is : in the mapping , direct mapping option that is available to map the same source and target fields is disabled . I do know that this is due to some java version issue .
    What I want to know is there any possibilty of solving this issue without installing an updated java version ?
    Regards
    Vinay P.

    I've faced the same for many times and all of that were due to Java version.
    1st of all, you have to check the authorizations you have. If you have enough (DEVELOPER_J2EE, CONTENT_ORGANIZER_J2EE, and so), and - obvious but very often forgotten - you have to assure you're trying to change it in the message mapping change mode On.
    Then, last shot should be downgrade your Java version.
    The 1.4.2 JRE version allow you to use not only the Mapp the Identical field but also Dependencies, Clear Mapping and some other tools/buttons. As mentioned above, if there's a fix in the new Java releases, I do not know (hope so) and would appreciate if you could let us know.
    Tks.

  • How to map different fields to same repeating/Same field in XSD

    Hi,
    I am using the Transform activity in a BPEL Process, my source is a Database table and the target is the and XSD file.
    Now the requirement is to map 3 different fields from source to a single field in the XSD.
    In the final xml file the tag name would be the same and will repeat 3 times but with different value for attribute and values with 3 diiferent columns/fields from database.
    How can achive this kind of mapping. Do i need to use some functions etc for that? please guide
    regards

    To answer "What does "<ns1:Code>" and "<ns1:Id>" indicate? are they fields in the DB table or XSD Schema?".
    The transformation is from Source(database) to target(an XML file).
    "<ns1:Code>" and "<ns1:Id>" are tags/fields in the outbound XML.
    <dbcolumn1>,<dbcolumn2> and <dbcolumn3> are database columns.
    I have removed the "ns1:" and also the Condition to make the code easy to read. Hope it helps. You could remove the condition and see how it goes when trying out in your project.
    <xmltag1_non repeating>
    <xsl:choose>
         <xsl:when test="SOME CONDITION" >
         <xml_tag2_repeating>
              <xsl:if test="SOME CONDITION">
                   <Code>
                   <xsl:value-of select="string(&quot;SOME VALUE 1 &quot;)"/>
                   </Code>
              </xsl:if>
              <xsl:if test="SOME CONDITION">
                   <Id>
                   <xsl:value-of select="dbcolumn1"/>
                   </Id>
              </xsl:if>
         </xml_tag2_repeating>
         </xsl:when>
    </xsl:choose>
    <xsl:choose>
         <xsl:when test="SOME CONDITION" >
         <xml_tag2_repeating>
              <xsl:if test="SOME CONDITION">
                   <Code>
                   <xsl:value-of select="string(&quot;SOME VALUE 2 &quot;)"/>
                   </Code>
              </xsl:if>
              <xsl:if test="SOME CONDITION">
                   <Id>
                   <xsl:value-of select="dbcolumn2"/>
                   </Id>
              </xsl:if>
         </xml_tag2_repeating>
         </xsl:when>
    </xsl:choose>
    <xsl:choose>
         <xsl:when test="SOME CONDITION" >
         <xml_tag2_repeating>
              <xsl:if test="SOME CONDITION">
                   <Code>
                   <xsl:value-of select="string(&quot;SOME VALUE 3 &quot;)"/>
                   </Code>
              </xsl:if>
              <xsl:if test="SOME CONDITION">
                   <Id>
                   <xsl:value-of select="dbcolumn3"/>
                   </Id>
              </xsl:if>
         </xml_tag2_repeating>
         </xsl:when>
    </xsl:choose>
    </xmltag1_non repeating>

  • Validate same field, same form, different actions

    Hi !
    I have the following problem. I have a single form with one field = sum and two buttons = withdraw and substract. I need to do the followings validations :
    a) sum must be an integer > 0;
    b) is substract is pressed sum < = existing account's value.
    Here are fragments from code :
    bank_operations.jsp
    <html:form action="/operations">          
         Sum (value): <html:text property="sum" />          
         <html:messages id="err_sum" property="sum">
              <bean:write name="err_sum" />
         </html:messages></p>
         <html:submit property="submit">     
              <bean:message key="button.withdraw" />
         </html:submit>
         <html:submit property="submit">     
              <bean:message key="button.substract" />          
         </html:submit><br>     
    </html:form>
    Here is SumForm
    public class SumForm extends ActionForm {
    private String sum;
    setters / getters
    public ActionErrors validate(ActionMapping mapping,
         HttpServletRequest request) {
         ActionErrors errors = new ActionErrors();
         if (!isNumeric(getSum())) {
         errors.add("sum", new ActionMessage("errors.sum.numeric"));
         request.setAttribute("account", account);
         } else {
         if (Integer.parseInt(getSum()) < 0) {
              errors.add("sum", new ActionMessage("errors.sum.numeric"));
              request.setAttribute("account", account);
         return errors;
    Here is the Action file :
    public class SumAction extends LookupDispatchAction { 
    public ActionForward withdraw()...
    public ActionForward substract()...
    Here is the struts-config.xml
    <action
    path="/operations"
    type="struts.action.SumAction"
    name="sumForm"
    scope="session"
    parameter="submit"
    validate="true"
    input="/pages/operations_struts.jsp">
                   <forward name="success" path="/pages/operations_struts.jsp" />
                   <forward name="failure" path="/pages/operations_struts.jsp" />
    </action>
    The problem is : If I know that only in the Action file I know which button was pressed , how can I made two different validation for the same field /same form , but different buttons pressed ? Or can I update validate method from SumForm file from the Action file? (where I can know which buttons was pressed).
    Thank for every your ideea !
    Forgot the details : it's about Struts2 . :)

    Thanks for your reply, but unfortunately I didn't get the idea. Where I should put that line? In the validate method of the form file?
    If this is the case, in page for <html:submit element what should I declare? I saw that something like id or name, I think is not supported by Struts. I'm not sure.
    Thanks again.

  • Best way to map CLOB database fields?

    I ran into a problem mapping CLOB fields a couple of months ago and couldn't find an easy answer to the problem. I got sidetracked and now find myself back at the same point...
    What is the best practice for mapping CLOB database fields in the mapping workbench? Do you map them as serialized (as a note I've got here) or can someone point me in the proper direction please? I've got everything else functioning properly, but I left my CLOB fields out of my mapping because they were giving me such trouble. Now, I need to get back to that specific area.
    ~ Tiffani

    Hi Tiffani,
    SerializedObjectMapping is generally used to map a multimedia object (for example image)to a BLOB field. For CLOB, I use simple direct-to-field mapping, and TopLink conversion manager will handle the read/write from the object String/Char[] to CLOB.
    King

  • Is there a way for a form user to load graphics and text in same field?

    I am aware that you can load text into a text field and graphics into an image field.  However, I would like to load a document containing text and graphics (e.g., MS Word or RTF) into a single field on a PDF form.  Is there any way to do this?

    Paul,
    I believe that the example of attaching a file that you have provided will solve the problem.  I am using LiveCycle Designer, so using the code that is in your example should be no problem.  The end-user will use Adobe Reader, so as you mentioned, I will use Acrobat to extend the features so that the form can be used by Reader.
    Thanks so much for your help,
    Daniel
    From: pguerett <[email protected]>
    To: Daniel Beinart <[email protected]>
    Sent: Monday, April 25, 2011 3:03 PM
    Subject: Re: Is there a way for a form user to load graphics and text in same field?
    It is part of the PDF AcroForm side of things .....Are you using Reader or Acrobat to fill the form. If Reader then you will have to Reader Extend to make this work ....if Acrobat then you simply need to add some code. I have attached a sample that shows you how to do it if you want it.
    Paul

  • Is it possible to map the cmp fields of the entity bean with out dictionary

    Dear sirs,
    I have created the EJB project module and WEB Module. Now i have to map the CMP fields of the entity bean to the underlying table. Is it possible to map the cmp fields of the entity bean with out java dictionary? If yes how can we do that.
    I have got some error while mapping an EJB's CMP fields to the table through dictionary. I was actually intended to map 79 fields but it gives an error that more than 64 fields are not allowed while building the dictionary.
    1. Can you tell me what could be the possible reason?
    2. Is it possible to map the cmp fields of the entity bean with out java dictionary? If yes how can we do that.
    Kindly helo me,
    Sudheesh K S

    Hi,
    Sudheesh please check up if the below link helps,there are other ways of writing the persistent.xml for container managed entity bean.
    http://help.sap.com/saphelp_nw04s/helpdata/en/9b/f695f0c84acf46a4e0b31f69d8a9b7/frameset.htm, probably in the studio you cannot browse through tables not in  the java dictionary,but manually editing it may still solve the problem.
    Also here is another link that specifies the databases supported by J2EE Engine.
    http://help.sap.com/saphelp_nw04s/helpdata/en/66/a5283eeb47b40be10000000a114084/frameset.htm
    The below link shows how to specify the database vendor and datasource
    http://help.sap.com/saphelp_nw04s/helpdata/en/e1/67fc3ee241ba28e10000000a114084/frameset.htm
    Hope you are able to solve the problem.
    Do let us know if you come up with the solution.
    Regards,
    Harish
    Message was edited by: HARISH SUBRAMANIAN

  • Mapping ECC PO fields to R/3 PO fields

    Hi Experts,
    I was trying map ECC Po fields to R/3 fields which are not mapping in standard way automatically. Like Tracking No and Good Recipient name.
    I am using the BADI BBP_ECS_PO_OUT_BADI to map these fields.
    However i am able to map and see those fields in the back end.
    The same thing i was trying to do for the Text fields. Suppose, mapping vendor text to item text .these fields are not able to transfer through this BADI.
    for this i am using the BADI BBP_PO_INBOUND_BADI in R/3 to map these fields . I am able to map and see those text fields in R/3 also. But wonder now i am not able to see Tracking No and Good Recipient name fields in R/3 .
    Any pointer to solve this issue, really a help for me.
    Thanks in Advance.

    Hi Disha ,
    Thank you so much for your reply ,
    Actually i have implemted the BBP_ECS_PO_OUT_BADI this BADI only in SRM side .When i have implemeted i can see Tracking No and Goods recipient are mapping correctly in Back End . But the thing is only the text fields are not mapping the correctly. though code was correct .
    So i have implemeted the BBP_PO_INBOUND_BADI BADI in the R/3 side , through this one i can able to map the text fiedls , where as this time Tracking No and Goods recipient are not mapping .Any pointers for this , will really help for me .
    *See my code for BBP_ECS_PO_OUT_BADI*
    *Vendor text at line item level of SRM PO should be passed to
    *u2018Item Textu2019 at R/3 PO line item level.
      LOOP AT it_item INTO WA_PO_ITEM.
        Read table IT_LONGTEXT into wa_LONGTEXT with key Guid = WA_PO_ITEM-guid
                                                         tDid = 'ITXT'.
        IF SY-SUBRC EQ 0.
          W_PO_ITEM_TEXT-PO_NUMBER = WA_PO_ITEM-BE_OBJECT_ID.
          W_PO_ITEM_TEXT-PO_ITEM  = WA_PO_ITEM-NUMBER_INT+5(5).
          W_PO_ITEM_TEXT-TEXT_ID   = 'F01'.
          W_PO_ITEM_TEXT-TEXT_FORM = '*'.
          W_PO_ITEM_TEXT-TEXT_LINE = WA_LONGTEXT-TDLINE.
          APPEND W_PO_ITEM_TEXT TO CT_BAPI_POITEM_TEXT.
        ENDIF.
    *Internal Note at line item level of SRM PO should be passed to
    *u2018Info record noteu2019 at line item level of R/3 PO
        Read table IT_LONGTEXT into wa_LONGTEXT with key Guid = WA_PO_ITEM-guid
                                                           tDid = 'NOTE'.
        IF SY-SUBRC EQ 0.
          W_PO_ITEM_TEXT-PO_NUMBER = WA_PO_ITEM-BE_OBJECT_ID.
          W_PO_ITEM_TEXT-PO_ITEM  = WA_PO_ITEM-NUMBER_INT+5(5).
          W_PO_ITEM_TEXT-TEXT_ID   = 'F06'.
          W_PO_ITEM_TEXT-TEXT_FORM = '*'.
          W_PO_ITEM_TEXT-TEXT_LINE = WA_LONGTEXT-TDLINE.
          APPEND W_PO_ITEM_TEXT TO CT_BAPI_POITEM_TEXT.
        ENDIF.
      ENDLOOP.
    *Vendor Text at PO header level should be passed onto R/3 PO header text field.
      Read table IT_LONGTEXT into wa_LONGTEXT with key Guid = IS_HEADER-GUID
                                                       tDid = 'HTXT'.
      IF SY-SUBRC EQ 0.
        WA_Header_text-PO_NUMBER = IS_HEADER-BE_OBJECT_ID.
       WA_Header_text-PO_ITEM  = WA_PO_ITEM-NUMBER_INT+5(5).
       WA_Header_text-PO_ITEM+4(1)  = '0'.
        WA_Header_text-TEXT_ID   = 'F02'.
        WA_Header_text-TEXT_FORM = '*'.
        WA_Header_text-TEXT_LINE = WA_LONGTEXT-TDLINE.
        APPEND WA_Header_text TO CT_BAPI_POHEADER_TEXT.
      ENDIF.
    *Map the Tracking No
      LOOP AT it_item INTO WA_PO_ITEM.
        Read table CT_BAPI_POITEM into WA_BAPI_ITEMS with key PO_ITEM = WA_PO_ITEM-NUMBER_INT+5(5).
        WA_BAPI_ITEMS-TRACKINGNO = WA_PO_ITEM-BE_TRACKING_NO.
        MODIFY TABLE CT_BAPI_POITEM FROM WA_BAPI_ITEMS TRANSPORTING trackingno.
      ENDLOOP.
    *The user id of the Partner Function u2018Goods recipientu2019 is map to
    *R/3 Goods Recipient field
      LOOP AT it_item INTO WA_PO_ITEM.
        Read table IT_PARTNER into wa_partner with key P_GUID = WA_PO_ITEM-guid
                                                       PARTNER_FCT = v_grfun.
        IF SY-SUBRC EQ 0.
          SELECT SINGLE CHUSR
                 FROM BUT000
                 INTO v_grname
                 WHERE PARTNER_GUID = WA_PARTNER-PARTNER_NO.
          Read table CT_BAPI_POACCOUNT into WA_POACCOUNT with key PO_ITEM = WA_PO_ITEM-NUMBER_INT+5(5).
          WA_POACCOUNT-GR_RCPT = V_GRNAME.
          MODIFY TABLE CT_BAPI_POACCOUNT FROM WA_POACCOUNT TRANSPORTING GR_RCPT.
        ENDIF.
      ENDLOOP.
    endmethod.
    See my code BBP_PO_INBOUND_BADI
    APPEND LINES OF bbp_potextheader TO bapi_potextheader.
    APPEND LINES OF BBP_POTEXTITEM TO BAPI_POTEXTITEM.
    Evem i tried to map these traking no and good recipient fields in the R/ 3 , I have this piece of code in the Back end , But couldnt work for me.
    LOOP AT BBP_POITEM INTO WA_BBP_POITEM.
       Read table BAPI_POITEM into WA_BAPI_POITEM with key PO_ITEM =
              WA_BBP_POITEM-PO_ITEM.
       WA_BBP_POITEM-TRACKINGNO = WA_BBP_POITEM-TRACKINGNO.
      MODIFY table BAPI_POITEM FROM WA_BAPI_POITEM TRANSPORTING trackingno
       Read table BBP_POACCOUNT into wa_BBP_POACCOUNT with key PO_ITEM =
               WA_BBP_POITEM-PO_ITEM.
       wa_BAPI_POACCOUNT-GR_RCPT = wa_BBP_POACCOUNT-GR_RCPT.
       MODIFY table BAPI_POACCOUNT FROM wa_BBP_POACCOUNT TRANSPORTING
    GR_RCPT.
    ENDLOOP.
    Loop at BAPI_POITEM into wa_BAPI_POITEM.
       Read table BAPI_POITEMX into wa_BAPI_POITEMX with key PO_ITEM  =
    wa_BAPI_POITEM-PO_ITEM.
       wa_BAPI_POITEMX-TRACKINGNO = 'X'.
    MODIFY table BAPI_POITEMX FROM wa_BAPI_POITEMX TRANSPORTING TRACKINGNO
    Read table BAPI_POACCOUNTX into wa_BAPI_POACCOUNTX with key PO_ITEM  =
    wa_BAPI_POITEM-PO_ITEM.
       wa_BAPI_POACCOUNTX-GR_RCPT = 'X'.
       MODIFY table BAPI_POACCOUNTX FROM wa_BAPI_POACCOUNTX TRANSPORTING
      GR_RCPT.
    Endloop.

  • How to map user-defined fields in XML communication on SRM site

    Hi All!
    We use the External sourcing scenario and we transfer requirements from ERP  in SRM through XI (PurchaseRequestERPSourcingRequest_In)
    We should transfer the user-defined fields, but we can not map it in SRM site.
    We have enhanced enterprise service in XI, have realized BADI PUR_SE_PRERPSOURCINGRQCO_ASYN on ERP site.
    I see the XML message with ours z-fields in tr.  SXI_MONITOR (into SRM), but I can not find it in BBP_PDISC.
    We try to use BADI BBP_SAPXML1_IN_BADI (there is no method for SC), and BADI /SAPSRM/BD_SOA_MAPPING (z-fields is empty)
    Someone can tell how to map user-defined field for SC?
    Thanks in advance
    Evgeny Ilchenko

    Hello, Julia
    We have found solution our problem
    We have enhanced standard service in a new enhancement name space and defined own enhancement elements in our namespaces. Then these enhancement elements refered to the SAP standard Enterprise Service.
    But In our new interfaces were different  XML namespaces
    When we have correct an error we could use the next BADI
    on ERP site: PUR_SE_PRERPSOURCINGRQCO_ASYN
    on SRM site: /SAPSRM/BD_SOA_MAPPING
    BR,
    Evgeny

  • In OWB I need to update the target table with same field for match/update

    In OWb I am trying to update the target table with the match and the update on the same field can this be done. I am getting a error match merge error saying you cannot update and match on the same field. But in SQl my select is
    Update table
    set irf = 0
    where irf = 1
    and process_id = 'TEST'
    Hwo do i do this in OWB.

    table name is temp
    fields in the table
    field1 number
    field2 varchar2(10)
    field3 date
    values in the table are example
    0,'TEST',05/29/2009
    9,'TEST',05/29/2009
    0,'TEST1',03/01/2009
    1,'TEST1',03/01/2009
    In the above example I need to update the first row field1 to 1.
    Update temp
    set field1 = 1
    where field1 = 0
    and field2 = 'TEST'
    when I run this I just need one row to be updated and it should look like this below
    1,'TEST',05/29/2009
    9,'TEST',05/29/2009
    0,'TEST1',03/01/2009
    1,'TEST1',03/01/2009
    But when I run my mapping I am getting the rows like below the second row with 9 also is getting updated to 1.
    1,'TEST',05/29/2009
    1,'TEST',05/29/2009
    0,'TEST1',03/01/2009
    1,'TEST1',03/01/2009

  • Table Control - Cursor placed on same field

    Hi,
       I am facing one problem in a User defined Screen that having Table control.
       I written some validations for each and every field in Screen including Table control.
       But each & every time i am pressing Enter , the cursor is going to first field in the screen . I want to restrict this one...i want to be cursor on the field which i entered value at that time or next navigation field.
       How i can achieve this...cursor should stay on the same field , it should not go to first field.
       Pls give ur suggestions...
    Thanks in Advance,
    Best Regards,
    pavan.

    Hello Pavan,
    This is the first time I'm coming across this problem and I find it quite peculiar. Anyways, I can think of one option that you can try out.
    Use the option GET CURSOR FIELD to get the cursor in the PAI event and then use the SET CURSOR FIELD statement in the PBO to set the cursor to the appropriate field.
    Regards,
    Anand Mandalika.

  • Problem with Qualified lookup field

    Hi all
    I have one qualified lookup field in main table of the repository. when i created the iview for ItemDetails then i selected all the fields of the main table which includes the qualified look up field . but when i see the preview then i am not able to see the field of qualified lookup field in the preview. it is not displaying but i selected the same field.
    please help me out on Can we enter the data in the qualified table field which is part of main table in the repository while creating the record??
    but i am able to edit the qualified lookup field which is part of main table. but the only problem while creating the record it is not displaying me the qualified lookup field. please help on this........
    Thanks
    Regards
    Sunil

    Hi Sunil,
    It will not allow you to add the qualified lookup value in the main table record directly.
    As the qualified lookup field in the mai table links the main table record with the qualified table fileds.
    You will only be able to view the non-qualifier field values in the main table but the qualifier value  for that particular record will be visible in the qualifier table only.
    So as to populate the lookup qualifier you need to create the main rec then you can establish the link and populate the qualified table fields.
    Hope it helps
    Kindly reward points if found useful
    Thanks
    Simona

  • Problem having the cloumn fields in the heading(REP:1317)

    Hi
    I am having a problem having a column field in the Header.I followed the instructions in the help i.e creating a field and then referencing it with a boiler text(&<field name>).But When I run the report I get the error message
    "REP-1317: Boilerplate '<boilerplate name>' references field with source '<column name>' at wrong frequency."
    How do I set these two field in the same frequency.
    Can anybody help.
    Thanks

    Hi
    See my answer at YOUR topic "Unable to have the column fields in the header".
    Once more: the only way to solve the problem is to create in the Header the Repeating Frame linking with the group of "<field name>". Then it's possible to place Field to be referenced by "database_col" or boiler text such as "&<field name>".
    Andrew.

  • Pull more than one field into the same field in a report.

    I am attempting to put together a report in Visual Studio 2008. It seemed a simple report at first, but as I am creating the SQL, I am having a little trouble conceptualizing how to get it to work exactly as needed. Here is the issue...
    In this case, the report should show two rows for each department. One is the count of who within an audience (that will be set up as a parameter) completed a certain course (the course may also be a parameter). The next row should be
    a count, within that same department, of all users within the audience. Both counts should be within the same field on the report, but on different rows.
    My thought was to create two CTE's. One would contain the counts, by department, of everybody in the audience. The other would contain the counts, by department, of those within the audience who completed the given course.
    The problem is, though, I need to then have these two counts by department on two separate lines, and they should be within the same field. Basically, the idea is they are the numerator and denominator. There would also be a field before the count that would
    need to identify which one it is. For the sake of the example, call it "Measure_ID" and it would say "CourseCert" for the count of who completed the course and "CourseAvail" for the count of those who are part of the audience.
    Let me know if that makes sense, or if I can provide any further clarification to help you better understand what I am trying to achieve. Does anybody have thoughts on how to do this?

    Unfortunately, the counts need to be in separate rows. If they could be in the same row, it would have probably been a lot easier. I think I could have just done a couple "Case When" type formulas within the list of things under "Select."
    As it is, I need the two counts to show up under the same heading in separate rows. Unfortunately, the table structure of this database is very complicated. I think it would likely just further confuse things if I tried to share all of that detail here.
    That is why I was trying to be generic.
    Unless there is another easier way I am missing, I was thinking the easiest way to achieve what I needed was to use two CTE's. One would list all users by department who belong to a specific audience (the audiences are what we use to then assign them
    to certain courses, so the audience would be the people who are required to complete a certain course). The other would list all user by department who are in that audience and have completed a particular course. I think I am fine to complete that part.
    It is just getting them to then display as in my example that I am not sure how to do.
    The desired result, as you see in my example, has two lines per department, the first being a count of those who completed the course ("Certified"). The second line being a count of those who are required to complete it ("Available").
    Does that help? I was basically hoping somebody had an example they could use, just with fake table names so I could adapt it to my data. If it helps, though, let's pretend the two CTE's are like this:
    Table Name: Certified
    Table's purpose: This table would list all people who had completed the course.
    Fields:
    CourseName
    CourseCode
    AudienceName
    AudienceCode
    CompletionResult
    EmpCode
    DepartmentCode
    Table Name: Available
    Table's purpose: This table would list all people who are assigned to the audience.
    Fields:
    AudienceName
    AudienceCode
    EmpCode
    DepartmentCode
    The desired result would then count the EmpCodes, by department, from each table in that Measure_Amount field so it could display as I showed above. Does that make sense? I apologize if that does not help to clarify. I was trying to be as simple
    as possible so you could just use it as a generic example.

Maybe you are looking for