How to Print the same field value in a single row

Hi,
I need to print the same field values in a single row
For Examble
in a table TestTable
ID Name Value
1 AB 120
1 BC 150
1 CD 130
2 AB 111
2 BC 112
2 CD 113
I need the query like if the Name contains BC and CD then i need to print like ID, BC Value, CD Value as below
ID BC'Value CD'Value
1 150 130
2 112 113
Kindly suggest me...
Thanks in Advance
Anu

Hi,
Since you're on 9i some available functionality unfortunatly isn't at your disposal.
This should work, however, using your sample data:
MHO%xe> create table t as ( -- generating sample data:
  2  select 1 cid, 'AB' cname, 120 cvalue from dual union all
  3  select 1, 'BC', 150 from dual union all
  4  select 1, 'CD', 130 from dual union all
  5  select 2, 'AB', 111 from dual union all
  6  select 2, 'BC', 112 from dual union all
  7  select 2, 'CD', 113 from dual
  8  );
Tabel is aangemaakt.
MHO%xe> select cid
  2  ,      max(decode(cname, 'BC', cvalue, null)) BC_value
  3  ,      max(decode(cname, 'CD', cvalue, null)) CD_value
  4  from   t
  5  group by cid;
       CID   BC_VALUE   CD_VALUE
         1        150        130
         2        112        113For reference and future challenges, see:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:419593546543
http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php

Similar Messages

  • How to get the maximum/largest value in a single row?

    I have a simple Pivot table view with dollars as the measure, months on the columns and accounts on the rows.  I want to highlight the month that had the largest value.  E.g. so if the dollar values for account Revenue are 10 for Jan, 11 for Feb, 50 for Mar and 0 for the rest of the months, then I want to highlight the cell with 50 green. So essentially I need to be able to identify the max value in a row in the pivot table. 
    If I add a max calculation, it returns the top value across all columns and rows. A Rank calculation also returns rankings across all columns and rows. How can I determine the largest value in a single row?
    Thanks
    J

    In general you have to go by level based measures. Just tweak it as max(revenue by Year)
    Just do it in Criteria tab and see how it works and I thing rest you know how to do

  • How to pass the FORM Fields value by Form Personalization

    Hi ALL,
    I want to pass form filds values in to procedure. I am calling this procedure through form personalization of that form..... But it's not accepting any form field's value there... when i am passing hardcoded vales procedure is executing fine...
    can any one suggest what to do???
    i tried with these syntax
    TEST_EMP_FP(:ADDR.ADDRESS_ID,'ABC')
    TEST_EMP_FP(${item.ADDR.ADDRESS_ID.value},'ABC')
    Regards
    Ravi

    Hi,
    Iam calling an SRS from forms personlization. Can any body tell me how to pass the Form field values as parameters to the Reports. (Example when they call this Concurrent request from Transact5ions screen, The invoice number should be defaulted in the report parameter).
    Regards,,
    Anil.

  • HT2486 How to print the same return label on Avery labels

    I am trying to print the same return label on an Avery 5160 and cannot. It only shows one label, not 30 of the same.
    Was on the phone with Apple support but we could not make it work either.
    Anyone knows?
    Thanks

    REDP,
    I am sorry, but to get your issue more exposure I would suggest posting it in the commercial forums since this is a commercial printer. You can do this at http://h30499.www3.hp.com/hpeb/ .
    I hope this helps.
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

  • How to print the same picture multible times on one page

    how can i print the same picture multible times on one page
    Message title was edited by: Brett N

    Select all of the images you would like to print in the Elements Organizer, then go to File > Print. In Step 4, choose Picture Package from the drop-down menu. In Step 5, click the option to Fill Page with First Photo.

  • How to Supply the form field values to a pdf form when loading it

    I am working on a web site project using Asp.net where the user has to fill in a PDF eform in acrobat reader. Then when he clicks on submit it returns to my asp.net app and the PDF form supplies the values back to my asp.net app. So my asp.net app has the values that were filled in the PDF form and can save those values and work with them...
    OK.
    What I need to know is when I am in my asp.net app, and the user wants to go back and reopen the same form, from my asp.net app..... then how do I pass back the values that were saved back to the PDF form??
    I know if I had a way to pass the values to the PDF form in some way then in the Doc.open or doc.load event of the form I could easily write a little javascript to plug in the values in the PDF form fields.
    but how do I pass those values from my asp.net app to my PDF form???
    thanks

    Thanks bcweed for all the info. I fixed my problem, it had something to do with LiveCycle Designer. If I just use Acrobat to add the form fields, then the FDF works fine. As to your situation with the SavToBuf, that happens to be the method that I am using, so I will just post my code here, and maybe you can pick out what is different from yours. The Response.BinaryWrite(FDFin.FDFSaveToBuf)is at the bottom.
    Sql = "SELECT * FROM Invoices" & WHERE
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open Db_Conn_Str
    Set Rs = Server.CreateObject("ADODB.Recordset")
    Rs.Open Sql, Conn, adOpenStatic, adLockReadOnly, adCmdText
    If Not Rs.EOF Then
    End If
    Set FdfAcX = Server.CreateObject("FdfApp.FdfApp")
    Set outputFDF = FdfAcX.FDFCreate
    'VendorID = VendorName = VendorNum = InvoiceDate = PreparedBy = ""
    Gross = 0
    For I=0 To Rs.RecordCount-1
    If InStr(VendorID,Rs.Fields("VendorID")) = 0 Then
    VendorID = VendorID & Rs.Fields("VendorID") & ", "
    End If
    If InStr(VendorName,Rs.Fields("VendorName")) = 0 Then
    VendorName = VendorName & Rs.Fields("VendorName") & ", "
    End If
    If InStr(InvoiceNum,Rs.Fields("InvoiceNumber")) = 0 Then
    InvoiceNum = InvoiceNum & Rs.Fields("InvoiceNumber") & ", "
    End If
    If InStr(InvoiceDate,Rs.Fields("InvoiceDate")) = 0 Then
    InvoiceDate = InvoiceDate & Rs.Fields("InvoiceDate") & ", "
    End If
    If InStr(PreparedBy,Rs.Fields("PreparedBy")) = 0 Then
    PreparedBy = PreparedBy & Rs.Fields("PreparedBy") & ", "
    End If
    Rs.MoveNext
    Next
    Rs.MoveFirst
    outputFDF.FDFSetValue "VendorID",VendorID,False
    outputFDF.FDFSetValue "VendorName",VendorName,False
    outputFDF.FDFSetValue "InvoiceNum",InvoiceNum,False
    outputFDF.FDFSetValue "InvoiceDate",InvoiceDate,False
    outputFDF.FDFSetValue "PreparedBy",PreparedBy,False
    For I=0 To Rs.RecordCount-1
    outputFDF.FDFSetValue ("Line."&I), Rs.Fields("Amount")&"", False
    outputFDF.FDFSetValue ("Company."&I), Rs.Fields("Company")&"", False
    outputFDF.FDFSetValue ("GL."&I), Rs.Fields("GL")&"", False
    outputFDF.FDFSetValue ("CC."&I), Rs.Fields("CostCenter")&"", False
    outputFDF.FDFSetValue ("DocNum."&I), Rs.Fields("DocNumber")&"", False
    Gross = CCur(Gross) + CCur(Rs.Fields("Amount"))
    Rs.MoveNext
    Next
    outputFDF.FDFSetValue "Gross", Gross, False
    Rs.Close
    Set Rs = Nothing
    Sql = "UPDATE Invoices SET DatePrinted = '" & Now() & "'" & WHERE
    Conn.Execute Sql
    Conn.Close
    Set Conn = Nothing
    outputFDF.FDFSetValue "PrintDate", Date(), False
    outputFDF.FDFSetFile "http://admin/invoices/pdf/InvoiceAuthorization.pdf"
    Response.ContentType = "application/vnd.fdf"
    Response.BinaryWrite outputFDF.FDFSaveToBuf
    outputFDF.FDFClose
    %>

  • Combining Multiple occurrencesof the same field value into one and Sum prob

    Hi
    I am trying to combine the multiple occurrences of the field values and sum the amount to the target
    Source
    <Record>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>5</Amount1>
    <Amount2>5</Amount2>
    </Item>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>15</Amount1>
    <Amount2>15</Amount2>
    </Item>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>5</Amount1>
    <Amount2>5</Amount2>
    </Item>
    </Record>
    Target
    <Record>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>25</Amount1>
    <Amount2>25</Amount2>
    </Item>
    </Record>
    I am using MM at present. All fields are KeyFields here. Should check against each other.
    I followed Context setting to the Root Item and Sort, SplitByValue and CollapseContext to achieve the functionality.
    But it checks against each field and not all fields. So either one field has different value, only that perticular field gets into New Node and not the entire record. In this case, i might need UDF i guess. Any UDF help is much appreciated
    Bad Target example of what i am getting
    Source
    <Record>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>5</Amount1>
    <Amount2>5</Amount2>
    </Item>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>15</Amount1>
    <Amount2>15</Amount2>
    </Item>
    <Item>
    <Item1>2</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>5</Amount1>
    <Amount2>5</Amount2>
    </Item>
    </Record>
    Target
    <Record>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>25</Amount1>
    <Amount2>25</Amount2>
    </Item>
    <Item>
    <Item1>2</Item1>
    </Item>
    </Record>
    In the above scneario, only Item1 returns the value into different node. But i like to have entire node values into the record, if one value changes in the entire record.
    Appreciate your help with the UDF in advance
    </Record>

    I think you are looking for string aggregation.
    The following are the replies posted by me in the forum recently on the same case.
    they might help you.
    Re: Concatenating multiple rows in a table - Very urgent - pls help
    Re: Doubt in a query ( Urgent )
    Re: How to remove words which consist of max 2 letters?
    Re: output like Name1,Name2,Name3...

  • How to use the same column value in the casecadeing parameter in ssrs report?

    Hi frnz,
    I have a table site contains one filed SiteCode
    Now i have fields like below using the below quries 
    SThe above are the two results sets coming from the single table ,now i will use these two results /Query in my ssrs Casecade report
    1.First result set/Query will use for the first dataset and use these values in the paramet1 selection as PrimaryCodes
    2.Second result set/Query will use for the second Dataset and use these values in the parameter2 as SecondayCodes
    3.Using these two datsets and create a Casecadeing paramet in ssrs report.
    4.so using this information how can i create the Casecade report ,I have tried different ways but i didnt get the soluction
    I have done the follw but ididnt get the o/p.
    I have created two parameter and mapped to the results but while paramter selection i will able to see only the first paramet(PrimaryCodes) ,and i will not see the second paramter(SecondaryCodes) it could not show me the second paramter values in the drop
    down list.
    Note:Here i will use the Single Table to get the all the sitecodes 
    Can some one please help me out for this report.
    Thanks.

    Hi,
    Try below links for your reference:
    http://blogs.msdn.com/b/sqlforum/archive/2011/05/26/ssrs-cascading-parameter-with-optional-select-all-in-sql-reporting-services-report.aspx
    http://msdn.microsoft.com/en-us/library/dd255197.aspx
    http://blogs.msdn.com/b/psssql/archive/2010/01/29/how-to-have-a-select-all-multi-value-cascading-parameter.aspx
    sathya - www.allaboutmssql.com ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **.

  • How to group together same field values in a internal table.

    Hi Gurus,
    Case:1
    Using AUFNR, i am retrieving data from RESB table.
    Fields (RSPOS, ALPGR, ALPRF,KZAUS, MATNR).
    If RESB-ALPGR (Alternate material group) is not initial, sort those values with ALPFR (Priority) after that group together same ALPGR values.
    1) Top most priority (ALPRF) value MATNR populate to IDOC field.
    2). Next top priority (ALPRF) value MATNR populate to IDOC field.
    Case2:
    using AUFNR, check RESB-KZAUS if it has a value '1'.
    then, check to see if there are RESB-RSPOS that has the same (repeated RSPOS values) Ex: RSPOS value 0002,0002.
    if yes, place the first RSPOS with KZAUS = 1. MATNR move to IDOC next RSPOS-MATNR value move to IDOC field.
    Points will be awarded for useful answers.
    Thanks in Advance.
    Sashi.

    Hi,
    Check this Example..
    DATA:BEGIN OF ITAB OCCURS 0,
    NAME(15) TYPE C,
    END OF ITAB.
    ITAB-NAME = 'peter'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-NAME = 'john'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-NAME = 'abrahm'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-NAME = 'daneyal'.
    APPEND ITAB.
    CLEAR ITAB.
    LOOP AT ITAB.
    WRITE:/ ITAB-NAME.
    ENDLOOP.
    Reward Points if found helpfull..
    Cheers,
    Chandra Sekhar.

  • How to validate the incoming field value and raise an alert message

    Dear all,
    I have the following structure
    If incoming value for the field externalid is empty then i have to raise a alert message to end user "externalid field is empty for the id : id number" and for all incoming values it should work. I used the following udf on field externalid with two arguments
    if(externalid.equals(""))
    throw new RuntimeException("externalid field empty for the following id : " +id);
    else
    return externalid;
    This is working fine for single record. But for many records(multiple occurences), this logic is not working as if records 2 and 3 fails it is showing exception externalid field is empty for the id : record 2.
    how to achieve the tranformation logic ?
    Regards
    Koti Reddy

    Hi Amit,
    I have tried the above udf, but still stuck-up.
    For the above structure shown in image, i have tested giving the following payload
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:upsertRequest xmlns:ns0="http://sap.com/xi/SFIHCM01">
       <sessionId/>
       <upsert>
          <type/>
          <sfobject>
             <id>1</id>
             <businessKeys>1</businessKeys>
             <type>1</type>
             <status>1</status>
             <externalId>1</externalId>
             <username>1</username>
             <firstName>1</firstName>
             <lastName>1</lastName>
             <mi>1</mi>
             <gender>1</gender>
             <email>1</email>
             <managerExternalId>1</managerExternalId>
             <hrExternalId>1</hrExternalId>
             <department/>
             <jobCode/>
             <division/>
             <location/>
             <timeZone>1</timeZone>
             <hireDate/>
             <empId/>
             <title/>
             <businessPhone/>
             <fax/>
             <addressLine1/>
             <addressLine2/>
             <city/>
             <state/>
             <country/>
             <zipCode/>
             <reviewFreq/>
             <lastReviewDate/>
             <matrixManagerExternalIds/>
             <defaultLocale/>
             <customManagerExternalIds/>
             <secondManagerExternalId/>
             <loginMethod/>
             <proxy/>
          </sfobject>
          <sfobject>
             <id>2</id>
             <businessKeys>2</businessKeys>
             <type>2</type>
             <status>2</status>
             <externalId>2</externalId>
             <username>2</username>
             <firstName>2</firstName>
             <lastName>2</lastName>
             <mi>2</mi>
             <gender>2</gender>
             <email>2</email>
             <managerExternalId>2</managerExternalId>
             <hrExternalId/>
             <department/>
             <jobCode/>
             <division/>
             <location/>
             <timeZone/>
             <hireDate/>
             <empId/>
             <title/>
             <businessPhone/>
             <fax/>
             <addressLine1/>
             <addressLine2/>
             <city/>
             <state/>
             <country/>
             <zipCode/>
             <reviewFreq/>
             <lastReviewDate/>
             <matrixManagerExternalIds/>
             <defaultLocale/>
             <customManagerExternalIds/>
             <secondManagerExternalId/>
             <loginMethod/>
             <proxy/>
          </sfobject>
          <processingParam>
             <name/>
             <value/>
          </processingParam>
       </upsert>
    </ns0:upsertRequest>
    No node is creating for success records, instead it throws exception that "externalid field is missing for the id": id     for empty externalid field value in second record.
    But my requirement is..... when i process 50 records, records with missing value for field externalid should raise an alert message to end user intimating him to check the externalid field for particular id. If the value for externalid field is present in incoming record/payload, then it should be passed to target system.
    How can i implement this logic ?
    Regards
    Koti Reddy

  • How to display the dataset field values in my ssrs bar chart report ?

    HI i have a Bar Chart report in that i want to display the dataset one  field values in my x-axis of my ssrs report? so how should i display those values into my bar chart report?
    consider i want to display the Every Qtrly details in my x-axis so how should i ?
    can you pls help me out for this 

    I have added the Category Group into my Report area with required field ,now i will get my required output.

  • How to use the same variable value for data entry and the planning sequence

    Hi,
    the scenario is the following:
    Using the WAD template a user enters cost center plan data. The cost center is selected by the chosen value for the variable "V1".
    Afterwards he shall push a button which starts a planning sequence (including saving the data and further functions). This planning sequence uses a filter that also contains the variable "V1".
    What or where has it to be defined that the planning sequence uses automatically the same value for the variable "V1" as selected for the data entry?

    You have to define in the planning function. The planning sequence is only a sequence and it read the planning functions underneath it.
    Ravi Thothadri

  • How to update the Customer field value of PO Item under the Delivery Address Tab?

    Hi Friends,
         i tried to update the Customer field Using Bapi_PO_change.I passed the PO Order no,POADDRDELIVERY data with Item no,Adrees no,Customer no.But i am getting no data changed message from return table.I attached the screen shots.So please suggest me the helpful information for resoving this issue.
    Thanks,
    Dinesh

    Thank you friends,
                My Problem was resolved.In my case i have passed the customer value in BAPI_PO_CHANGE POITEM Table with updated customer value.
    Thanks,
    Dinesh

  • How to read the input field value into ABAP variable?

    Hi All,
    i need a read the value of an input field into an ABAP variable,and i am doing this in the following way
    lstring = request->get_form_field('myFlag').
    here 'myFlag' is the input field name,but this is not returning me any value into lstring.
    I have gone through the SDN and tried to do this.
    could you please help me out to resolve this issue.
    Thanks in Advance,
    Praveena

    Dear Praveena
    In which event are you putting this code. Place it in oninputprocessing event(Page with flow logic Model of coding). Then it will surely work.
    Regards
    Vijay.M

  • How to save the own fields value in a Database

    Hi all
    We create some customers fields with eewb fields for Service Order, but the value we enter in it, are not saved into the database table CRMD_ORDERADM_H.
    Where and what we have to do to commit the values in the database?
    We are working with CRM2007 WEB UI.
    Best Regards
    Edited by: Luis Felice on Nov 18, 2008 9:14 PM

    Did you check that your new fields have been created in table CRMD_ORDERADM_H?
    If yes, then check the structure of context node BTAdminH in TX GENIL_MODEL_BROWSER.
    If the fields popup in both, then everything with the EEWB should have worked fine.
    The EEWB creates an include structure for the table. This structure is also include in all API (like the CRM_ORDER_MAINTAIN). Additionally it creates function modules that are called by the API and handle the additional fields. Thus you do not have to do any additional commit or coding.
    In case everything is in place and it does not work, you should probably open an OSS. Otherwise let the wizard in the EEWB create the extension again.
    cheers Carsten

Maybe you are looking for