Using 'if' condition in a xsl tranformation

Hi All,
I have requirement in which i have to convert a xml of the following format
<Root>
<Employee name="employee1">
<salary salType="actual" amt="10000">
<salary salType="virtual" amt="20000">
<salary salType="actual" amt="30000">
<salary salType="virtual" amt="40000">
<salary salType="virtual" amt="50000">
</Employee>
<Employee name="employee2">
<salary salType="virtual" amt="10000">
<salary salType="virtual" amt="20000">
<salary salType="actual" amt="30000">
<salary salType="actual" amt="40000">
<salary salType="virtual" amt="50000">
</Employee>
</Root>
into the xml of the following format
<Root>
<Employee>
<name>employee1</name>
<annualSalary>40000</annualSalary>
</Employee>
<Employee>
<name>employee2</name>
<annualSalary>70000</annualSalary>
</Employee>
</Root>
where 'annualSalary' in the output xml is the sum of 'amt' in the input xml where 'salType'='Actiual'
so, for employee1 'annualSalary'=10000+30000 and for employee2 'annualSalary'=30000+40000
I have completed the transformation to map the employee name and annualSalary (sum of all 'amt' in input xml irrespective of actual or virtual in 'salType').
But how can i filter only 'Actual' salType and sum their 'amt' using the xsl transformation
Thank you
Pavan

Hi Sen,
Thanks for your reply. i tried with your solution but still the required result is not obtained.
When i used your code what is happening is the 'annualSalary' element in the output xml is getting created only if there is atleast one 'Actual' salType in the input xml. If there is atleast one 'Actual' salType then 'annualSalary' element is getting created with sum of all the 'amt' irrespective of 'Actual' or 'Virtual' salType.
Hope you understand the problem, Please write me if you want any more clarification
Thank you
Pavan

Similar Messages

  • How to use if condition in XML Publisher Desk Top

    Hi..,
    How to use if condition in XML Publisher desk Top.
    Please guide me.
    Thanks,
    Suresh.

    What kind of condition you want to use?
    You can use Condition like this:
    <?xdofx:if condition then value1
    else if condition then Value2
    else Value3
    end if?>
    Please go thru XML Publisher User Guide.
    Thanks
    Ravi
    [email protected]

  • Using OR condition in RTF Template

    Hi,
    How to use OR condition in RTF?
    say for example,consider the EMP table.
    I want to show the employees of department 10 and 20 in my XML Publisher report.
    How can i write --
    if deptno = 10 or deptno =20 in RTF template

    you can add the condition in RTF template
    <?if:XMLfield=30 or XMLfield=10 ?> to display <?end if?>

  • Using If condition in For EACH Group

    Hi all,
    I want to use if condition in for-each-group. Basically my requirement is that i want to use dynamic grouping. There will be two groups and the upper group and lower group will be selected on the basis of a report parameter.
    I hope i made it clear enough. So please help me in this. Any ideas will be highly appreciable.
    Thanks and regards
    Naveed

    You can add a If condition filed after the for-each field
    for EG : <?if:ADDRESS_TYPE = 'Employee Address'?>
    and then add anothet field which has <?end if?>
    Hope this helps.
    Thanks,

  • Transformation issue while using IF condition.

    hi everyone,
    i am using bpel transformation based on the condition of field using IF condition.
    A       B          C          D
    10     20          30          40
    20     20          30          50
    30     30          20          60
    40     40          20          70
    now i need to apply IF condition in transformation on the filed B. if B = 20 transfer the data to one table or B NE 20 to other table
    now my issue is, it is able to differentiate the rows, but the data in the field in second table remains same 20.
    as i hope its storing the data in buffer location and writing it. after mapping with the fields in source.
    can anyone suggest, how to get the actual value after differentiating the records.

    Declare an internal table with two fields lar and another field for seconds.
    IF v_lar01 = 'MSTD' and v_vge01 = 'MIN'.
    it_time-lar         = lar1
    it_time-seconds = t_plpo-vgw01 * 60  " minutes to seconds
    else.
    it_time-lar         = lar1
    it_time-seconds = t_plpo-vgw01 " second
    endif.
    append it_time.
    IF v_lar02 = 'MSTD' and v_vge02= 'MIN'.
    it_time-lar         = lar2
    it_time-seconds = t_plpo-vgw02 * 60  " minutes to seconds
    else.
    it_time-lar         = lar2
    it_time-seconds = t_plpo-vgw02 " seconds
    endif.
    append it_time.
    and so on...at the end sum it_time-seconds and do the calculate to get hrs n minutes from seconds
    Mathews

  • Problem using a conditional suppress in a cross-tab ?

    is there a problem using a conditional suppress in a cross-tab on a row  or summarized field  in crystal XI?
    I am using the following conditional suppress on a summarized field and its rows
             If {@SortCode}=4 then true;
    Sortcode is a group sorting formula field
    the summarized field is a formula field as well.
    All of the summarized fields are suppressed although the cross- tab performs correctly on @Sortcode  and the summarized field when not using the condition        
    it seems to me to be a reporting flow issue although i've included "whileprintingrecords" and "evaluateafter" with no success.
    i have also moved the cross-tab from the report header to group header and applied a conditional suppress on the group header through section expert.
    this supresses the group i dont want but includes grand totals for each group and also varys the number of columns
    i can't filter on sortcode because one of the grand total calculations requires those records and a subreport or second cross-tab does not contain the same number of columns
    the cross-tab is necessary as a client may have columns spanning one to many pages
    thanks for your help

    Hi I have a similar problem,
    I have an clock in solution, where i have some dates with data such as, various entries for a date eg, 01/11/2010 1hr, 01/11/2010 3 hrs etc, 03/11/2010 2hrs , 05/11/2010 4.5hrs, 05/11/2010 4 hrs so i need total for each day and highlight only those days, where total is less than 4.5, including days which donu2019t have records eg 02/11/2010 & 04/11/2010, I summarise in totals using a cross tab, to get summarised output for each day as,
                Totals
    01/11/2010    4
    03/11/2010    2
    05/11/2010    8.5
    in order to get the dates which didnu2019t have records, i added a dataset from Excel spreadsheet where i just have a sequential dates for the year , and use record selection to select only those dates in range which i need to display, so the result i get
    01/11/2010    4
    02/11/2010    0
    03/11/2010    2
    04/11/2010    0
    05/11/2010    8.5
    so far so good, all using cross tab, now i want to suppress rows which have total > 4.5 so the result should be
    01/11/2010    4
    02/11/2010    0
    03/11/2010    2
    04/11/2010    0
    How can i do that?

  • Use Global Conditions when Deploying an Application to a User

    Hi,
    Use Global Conditions when Deploying an Application to a User:
    I would like to deploy App-V Application with User centic in mind. The problem is that when the user login to a specefic typ of desktop the application shall be deployed. But if the use login on there primary device or some other
    device with same SLA the Application shall not be deployed.
    I think I can use Global Conditions to solve this. I have read about GC and it looks like I could greate a GC rule that deploy the software if the computer is in an AD-group or maybe becas all this computer starts with same prefix, sp maybe
    if the computernamn starts with PC the application will get deployed.
    The issue is that there is differant SLA on the computers that the User login to. 
    Or what mor can I do?
    /SaiTech

    Just keep in mind this puts a load on AD, a Domain Controller can get tickled silly by these Global Conditions running from each of your Clients, depending on the scale of your environment it can have an impact. It's a great idea GC's, just need to consider
    what load you are putting on the infra when they run.
    Might not be an issue for\to you, worth nothing all the same.
    Robert Marshall | This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs

  • Using RB00 condition type for Price Adjustment

    Hi,
    I have to do a price adjustment due to some rounding issues in the pricing of my sales order.(Using standard Pricing Procedure RVAA01). I am thinking of using manual condition type RB00 at Item level that can accept both positive and negative values depending on the situation.
    If the calculated value>expected value then the user will enter negative RB00 value manually and
    if the calculated value<expected value then the user will enter positive RB00 value manually.
    The account key is however different in standard Pricing procedure for RB00 and it is ERS and for standard Base Price (PR00) it is ERL.
    So, my question is that does that make any difference if I maintain condition records in VKOA for RB00 same as PR00?

    Hi
    If you are looking for rounding then you round the decimals by not maintaining any decimals.But if it is a price adjustment then your approach is correct
    If it is VK11 then there is no need to maintain condition record for RB00 as it is a manual condition type at item level
    If you are talking to maintain revenue account determination VKOA then you have to maintain as whenever you give discount then it will hit some G/L account .So you should assign a G/L account also
    Regards
    Srinath

  • How to use "where" condition when we use update or delete in a dbadapter?

    Hi
    I want to update/delete a record in a database table based on one of its fields. Which means I have to use "where" condition to check the value of the field and only then I can decide whether or not the record can be updated/deleted.
    When I try to use the dbadapter update/delete options, I dont see any provision for writing the "where" condition.(May be I am missing something).
    I know that I can use the custom sql option and write an sql command to achieve this.
    But I would like to know if this can be done when using the update/delete option itself in the dbadapter.
    Thanks in anticipation.
    Ravi

    Hi,
    You can use the logical delete option. In that case you can supply a value for the column that indicates if a record is changed and have it picked up by the db adapter.
    Andre

  • V-41 tcode error :Table 304 is not defined for use with condition type PR00

    Hi All,
    I am trying to create a BDC using the transaction V-41. 
    The first screen has fields:
    ConditionType and Table, where I have to fill values ZPM1 and 800 respectively.
    But as soon as I enter the tcode v-41 and say enter, the above mentioned fields are already having the  values 'PR00' and ' 304'. Normally if you take an example fo t-code VA02, all fields are blank.
    Then an error message  is displayed:
    Table 304 is not defined for use with condition type PR00
    This behaviour is not allowing me to use the BDC feature.
    Please advise me on why this is happening. What are the possible solutions I can use to clear these values programmatically?
    Can anything be done via customizing?
    Regards,
    Namita.

    Dear ILHAN ,
    Well the problem you are facing is having the following solution:
    Table 304 is not defined for use with condition type PR00
    Message no. VK024
    Diagnosis
    The selected condition type does not fit in the condition table, that is the basis for the condition record. Alternatively the selected condition type is not included in the condition types that were selected on the selection screen or that are defined in the variant of the standard selection report.
    Procedure
    Úse F4 help to choose a valid condition type.
    If this does not give you the required condition type, check in Customizing for condition types and the related access sequences.
    In the condition maintenance also check Customizing for the selection report (pricing report), that you have selected in the navigation tree, using the standard condition table as a reference.
    I hope this helps.
    It has worked for me.
    I gave it a try and what I am getting using the transaction V-41 is create Price condition (PR00) : Fast Entry.
    Please award points if you find it useful.
    Regards,
    Rakesh

  • Very urgent (using join conditions in PI)

    Hi PI gurus.
    My scenario is SOAP to JDBC(Portal Webdynpro screen to Oracle database).
    I have a requirement to fetch some complex data from the database using complex nested queries.How can i go ahead using join conditions in PI.Here the client is insisiting only on queries and rejected all other methods for solving this like
    1)Java proxies
    2)stored procedures written in the database system
    3)Create a logical view in database system .
    The following option is permitted for me by the client to follow
    ·  Using the SQL_QUERY as a query method in the JDBC Receiver Channel in XI
    · Trying out JOIN conditions to make multiple query into a single query:- Here need to check the feasibility of the JOIN Condition
    Please help me to complete our task.
    points will be rewarded for helpful answers.
    Thanks & Regards
             Veena

    Define the data structures (Request & Response)
    A JDBC Synchronous scenario, the response message type name is dependent on the request message type name
    i.e., if request is
    Dear Raj,
    This is my scenario SOAP-to-JDBC(syn) with out using BPM's.
    4datatypes & message types,
    MT_JDBCRequest
    --->Statement1
    My response msg type
    MT_JDBCRequest_response
    >Statement1_response
    >row
    twoMessage Interfaces, two mappings (for request & response) and one interface mapping 
    Configure the Objects In Integration directory.
    Define the Web services and save the WSDL file After completion of configuration.
    WSDL file is used for the integration of Portal - PI scenario.
    Process Flow:
    1.     User requests for a report from the available list of PSMA reports by providing required set of input parameters.
    2.     Portal forwards the request with these input parameters to PI using web service model through SOAP protocol and the required results are derived from PI
    3.     Report is viewed on portal screen.
    Thanks & regards,
       Veena

  • Selecting Employees and Joins in PL/SQL using IF conditions

    how to get empno starts with 7 from emp and jobs is manager and sales manager and clerk those r joined in before 1981 year r in 1981
    i want pl/sql code for that one using if conditions

    {thread:id=2174552}
    {message:id=9360002}
    Short answer, read a book
    2 Day Developer's Guide
    http://docs.oracle.com/cd/E11882_01/appdev.112/e10766/toc.htm
    SQL Language Reference
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/toc.htm
    PL/SQL Language Reference
    http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/toc.htm
    Edited by: 3360 on Sep 10, 2012 9:26 AM
    Removed inappropriate thread specific text since post was moved by a moderator

  • Use of Condition update while creating Condition Records

    Hi Experts,
    I have to maintain MRP for a product which will be applicable for only 1 particular order. after which system should pick up old MRP.
    By using CONDITION UPDATE feature , i have tried to do it , but once maintained , its always picking new MRP for every order.
    (If it being a record where only new price to be defaulted in one order and no need to create 2nd order , this is ok ., but not in my case)
    Can any one suggest me how to go with this
    Thanks in advance,
    Jignesh

    Hi,
    This can be done using the CONDITION UPDATE
    In the condition type check the CONDITION UPDATE AND SAVE IT
    While creating the CONDITION RECORDS, maintain the values and click ont he ADDITIONAL DATA (F7) then maintain the value in the field MAXIMUM NUMBER OF ORDERS , PUT The sales order as 1.
    Then try
    Please revert if you need further details
    thanks,
    santosh

  • What is the difference using start condition and check function module

    what is the difference  between using start condition and check function module

    That's new to me, I thought a start condition was evaluated before the workflow started, and thus now workflow work item is available. That's why I think the only situation in which start conditions/check functions can't be used, is when the availability of a workflow log for investigation of exactly what stopped the workflow is a requirement.
    I suppose the <a href="http://help.sap.com/saphelp_46c/helpdata/en/4c/86bf43feca11d2a64f0060087a79ea/frameset.htm">SAP documentation</a> is in need of an update.

  • Using where condition with dynamic internal table

    Hi Friends.
    How to use where condition with dynamic internal table ?
    Regards,
    Amit Raut

    Hai Amit
    REPORT  ZDYNAMIC_SELECT                         .
    TABLES: VBAK.
    DATA: CONDITION TYPE STRING.
    DATA: BEGIN OF ITAB OCCURS 0,
    VBELN LIKE VBAK-VBELN,
    POSNR LIKE VBAP-POSNR,
    END OF ITAB.
    SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
    CONCATENATE 'VBELN' 'IN' 'S_VBELN.'
    INTO CONDITION SEPARATED BY SPACE.
    SELECT VBELN POSNR FROM VBAP INTO TABLE ITAB
    WHERE (CONDITION).
    LOOP AT ITAB.
    WRITE 'hello'.
    ENDLOOP.
    Thanks & Regards
    Sreenivasulu P

Maybe you are looking for

  • Request for help on Vendor Consignment stock and Customer Consignment Stock

    HI Experts, We have a requirement to segregate the Customer Consignment stock and Vendor consignment stock from the total Consignment stock available in the BW report. Currently in the report the calculation of total consignment stock is based up on

  • Is there a known bug with the zen vision;m and usb internet adapt

    i bought the zen m yesterday. i've down loaded it onto my pc. audible wont sync to it. the creative firmware updater wont update it keeps saying its not connected. Windows media player synced to it ( the only thing thats gone right so far lol ) and w

  • Nikon coolpix P6000 NRW files not recognized

    Hello, On my new Nikon, when I try to download the RAW images, neither iPhoto nor Image Capture will recognize the Nikon's RAW NRW format. If I shoot the images in JPEG, it is fine. If I use Nikon's included software, I can download the RAW images to

  • Improving Graphical Performance in OS X 10.5.6

    Hey, I'm new here. Just entered the Mac universe for the first time with a MBP 2.4 ghz (2GB RAM, 250 GB HD (5400)) I went this route because I wanted a Mac that I could also game on but I've been disappointed with the results so far. I've tried runni

  • Doubt regarding Record Statistics.

    Hi, Using an interface, I am updating a row. As per the execution log file, it's showing me No. of Updates as 1. However, No. of Rows is shown as 3. I went through ODI Developer's Guide which mentions about No. of Rows as Total number of rows handled