No repeated values and in ascendant sort

Hi all,
I'm trying to put this:
SELECT DISTINCT month FROM Concert ORDER BY month ASC;
(no repeated values and in ascendant sort) into EJB-QL. This is what I've worked out:
SELECT DISTINCT OBJECT(o)
FROM Concert AS o
ORDER BY o.month ASC
(month is a field in the bean )
But this (and several tries later) doesn't work.
What's wrong with it??
The query is for a findAll method -without- input parameters which returns a collection, is here the error??? If so, how can I solve it?
I'm totally lost and frustrated, I'd really appreciate some light
Thanks a lot in advance

Your query is currect if table name and attribute name are currect.
Can you write what type of error is comming?

Similar Messages

  • ALV: How do I suppress repeating values and page breaks on printed output?

    Good day, everyone!
    First, I've done a LOT of searching trying to find the answer to my question, but I'm not finding an answer.  If this has already been answered and you can point me to a URL, I would appreciate it.
    Here's my issue:  I have a rather simple ALV report.  It has the columns of Person ID, Personnel Number, For Period, In Period, and Amount.  I sort by Person ID and Personnel Number, and if the value repeats on the next line of the report, I want to suppress it (make it blank).
    I thought the answer was in the following code, where I set the GROUP attribute to asterisk:
      CLEAR sortcat_ln.
      sortcat_ln-spos      = '1'.
      sortcat_ln-fieldname = 'PERSONID_EXT'.
      sortcat_ln-up        = c_true.
      sortcat_ln-group     = '*'.
      APPEND sortcat_ln TO sortcat.
      CLEAR sortcat_ln.
      sortcat_ln-spos      = '2'.
      sortcat_ln-fieldname = 'PERNR'.
      sortcat_ln-up        = c_true.
      sortcat_ln-group     = '*'.
      APPEND sortcat_ln TO sortcat.
    It looks PERFECT on the screen -- the values are suppressed if they repeat, and everything appears together on one screen.  However, when I print the report, two things happen:  1) The values repeat on each row, even if they are the same, and 2) I get a page break after each Person ID / Personnel Number combination.
    I now realize that I can't use the GROUP attribute.  Is there some other way in ALV to blank these repeating values and keep all the rows together on one page, rather than page breaking after each value change?
    Thanks!
    Dave

    Hi
    Same requirement i had before, when i try to print preview. the output of the grid display is in grouping is ok, but when i print preview or print it doesnt cater the grouping and page breaks, so what i did i modify the internal table use in alv , after hitting the print preview/print with the format desired by the user. you can do that in user-command. see code below
    FORM user_command USING r_ucomm TYPE syucomm
                            rs_selfield TYPE slis_selfield.
      DATA lt_sort TYPE lvc_t_sort.
      CASE r_ucomm.
        WHEN '&RNT_PREV' OR '&RNT'.
          t_final_x[] = t_final[].
          PERFORM clear_redundant.
          PERFORM set_sort_criteria USING lt_sort.
        WHEN '&F03' OR '&PRINT_BACK_PREVIEW'.
          t_final[] = t_final_x[].
        WHEN OTHERS.
      ENDCASE.
    ENDFORM.                    "user_command
    hope it helps

  • Not Hiding Repeated values.

    When creating a query in the properties, I un-checked "Hide repeated value" and When I display the query in Bex, Its coming properly. Same values are repeated for each row(Which is what I want)...
    But the user want to create the query in Bex and display it in WEB. In this case even if we un-check the HIDE button, Its hiding in web...
    Anybody has any clue ???

    Yes, I understand. When you execute the query in web the system takes the default web template which is set in SPRO. The SAP delivered default template name is 0QUERY_TEMPLATE with BW 3.0B.
    You will have to check in your system which is the default template being used and make changes to enable this option, please note that any changes you make in that template will be affecting all the queries you execute in web. Another option is to add a context meny entry to toggle between Suppress text and Hide. You can also add the parameter SUPPRESS_REPETITION_TEXTS='' to the URL.
    Thanks.

  • Sorting Values and keeping Keys

    Hi,
    I was hoping someone might be able to help me. I would like to sort some key value pairs.
    I have the following data the key is a string and the value is an int.
    "John",26
    "George",25
    "Ian",33
    "Greg",25
    I would like to sort the names by age and output them e.g
    Greg George John Ian
    I have looked at this post using the TreeMap and TreeSet to sort based on values but this seems to only work for Strings. Another problem is that I think tree set needs unique values and in my case they're not unique.
    http://forum.java.sun.com/thread.jspa?threadID=634742&messageID=3688987
    I was wondering whether someone could help me sort out this problem
    Thanks in advance
    John

    You need to create an Object to encapsulate your data and then sort a collection of those objects. Something like this:
    http://forum.java.sun.com/thread.jspa?forumID=31&threadID=598401

  • Very Urgent: Insert sequenced and not repeated values in Column

    Hello all:
    I want help for this, I have master block called orders and details block from it called payments. payments block is a tabular block , I want that when user insert new record in orders and go to insert payments then the (payments.payment_no) column generate automatically as 1 ,2,3,4,5,…… values and this values must be unique for this record in orders block.
    Thanks.

    have look at Re: How  to auto generate (auto-increment) Sr Number in the detailed sectio
    and How  to auto generate (auto-increment) Sr Number in the detailed section?

  • Display only first value of the repeated values  in ALV report

    Hi,
    Test Data
    Doc No   Net Val   billing Doc value Qty
    1000      2000.00    567850.00
    1000      2000.00    567850.00
    1000      2000.00    567850.00
    2000      6000.00    767850.00
    In this type of ALV Report in which only the First field value of the repeated value  should be displayed.
    Doc No   Net Val   billing Doc value Qty
    1000      2000.00    567850.00
    2000      6000.00    767850.00
    I can display document value as like expected result in SORT ORDER in LAYOUT but the Quantity value,Net value  which cannot be done in SORT ORDER in LAYOUT.
    Please tell me the suitable solution.

    For a Sales Order there are two Invoice.
    Sales doc     Invoice No    Billed Qty    Net value                     Qtywith  material no
    5000              900             234774.00    456.00000                 65             123
                                             234774.00    456.00000                 25             456
                                             234774.00    456.00000                 35             898
                                             234774.00    456.00000                 20             496
                          901            634774.00    256.00000                 50               746
                                            634774.00    256.00000                 10               456
                                            634774.00    256.00000                 20               545
                                            634774.00    256.00000                 30               869
    I  need to print this billed Qty and Net value  only once in first line and it should not be deleted.
    I need the result like this
    Sales doc     Invoice No    Billed Qty    Net value                     Qtywith          material no
    5000              900             234774.00    456.00000                 65                     123
                                                                                    25                     456
                                                                                    35                     898
                                                                                    20                     496
    5001              901            634774.00    256.00000                 50                       746
                                                                                    10                       456
                                                                                    20                       545
                                                                                    30                       869               
    The same value should not be repeated for Billed Qty and Net Value.
    I can do that for Sales doc in sort order in layout but i couldn't do for Billed qty and Net Value.
    Please  help.

  • Mobile List Bind aggregation - repeated values?

    Hi all, i'm new to SAPui5 so please forgive me if this is already discussed.
    I'm calling a odata service (http://h03zdb.hcc.uni-magdeburg.de:8003/workshop/sessiona/12/Services/msgTab.xsodata/MSGTABLE?$filter=FROM%20eq%20%27STU…) and I get the values stored in a table in json. I want to show this in a list but there are repeated values created for the list. Is it because of bindAggregation?

    Here is the whole code.
    I used split app and added two models for the detail and master page.
    I'm very new to this so sorry for bad coding
    <html>
      <head>
      <meta http-equiv="X-UA-Compatible" content="IE=edge" />
      <title>SRH Chat</title>
      <script src="/sap/ui5/1/resources/sap-ui-core.js"
      id="sap-ui-bootstrap"
      data-sap-ui-libs="sap.m"
      data-sap-ui-theme="sap_bluecrystal">
      </script>
      <!-- only load the mobile lib "sap.m" and the "sap_bluecrystal" theme -->
      <script type="text/javascript">
      var sessionKey = "STUDENT01";
      // Login user to get session id
      var oDetailPage2 = new sap.m.Page("detail2");
      var url = "http://h03zdb.hcc.uni-magdeburg.de:8003/workshop/sessiona/12/Services/msgTab.xsodata/MSGTABLE?$filter=TO%20eq%20%27"+sessionKey+"%27%20&%20FROM%20eq%20%27"+sessionKey+"%27%20&$format=json";
      $.get( url, function(data1) {
      // create JSON model instance
      var oModel = new sap.ui.model.json.JSONModel();
      // set the data for the model
      oModel.setData(data1);
      // set the model to the core
      oMasterPage1.setModel(oModel);
      var contactList = new sap.m.List("newlist2",{
      title : "{FROM}",
      mode: sap.m.ListMode.SingleSelectMaster,
                select: function(oEv) {
      var item = oEv.getParameter("listItem");
      var desc = item.getTitle();
      retrieveMsgs(desc);
      function retrieveMsgs(desc)
      var aurl = "http://h03zdb.hcc.uni-magdeburg.de:8003/workshop/sessiona/12/Services/msgTab.xsodata/MSGTABLE?$filter=FROM%20eq%20%27"+desc+"%27%20&$format=json";
      $.get( aurl, function( data ) {
    // // create JSON model instance
      var oModel1 = new sap.ui.model.json.JSONModel();
    // // set the data for the model
      oModel1.setData(data);
      // set the model to the core
      oDetailPage2.setModel(oModel1);
      var contactList1 = new sap.m.List("newlist");
      var inputField = new sap.m.TextArea();
      var but1 = new sap.m.Button({text: "Send", tap: function(){
      // Send button press functionality
      var msg = inputField.getValue();
      var murl = "http://h03zdb.hcc.uni-magdeburg.de:8003/workshop/sessiona/12/WebContent/InsertMsg.xsjs?from="+desc+"&to="+sessionKey+"&msg="+msg;
      $.ajax({
            url: murl,
            type: 'POST',
            async: false,
            timeout: 30000,
            success : function (data2){
            var empty = "";
            inputField.setValue(empty);    // clear text area
      //Populate the List with Data from the Model (Set in the Controller of this View)
      contactList1.bindAggregation("items", {
      path : "/d/results", //Reference to the JSON structure
      template: new sap.m.StandardListItem({
      title: "{FROM}", //Refer the name field in the JSON data
      description: "{MSG}", //Address Field in the data
      type: sap.m.ListType.Navigation //Specify what to do while clicking/tapping an item in the list, in this example navigate to another view
      oDetailPage2.addContent(contactList1);
      oDetailPage2.addContent(inputField);
      oDetailPage2.addContent(but1);
      oSplitApp.to("detail2");
      //Populate the List with Data from the Model (Set in the Controller of this View)
      //oModel.createBindingContext("/d/results", null, {select: "FROM"},function(a){});
      contactList.bindAggregation("items", {
      path : "/d/results", //Reference to the JSON structure
      template: new sap.m.StandardListItem({
      title: "{FROM}", //Refer the name field in the JSON data
      //description: "{FROM}", //Address Field in the data
      //select: "FROM,TO",
      type: sap.m.ListType.Navigation //Specify what to do while clicking/tapping an item in the list, in this example navigate to another view
      var oMasterPage1 = new sap.m.Page("master1",{
        title : "Master"
      // adding the list to master
      oMasterPage1.addContent(contactList);
    // //add the master pages to the splitapp control
      oSplitApp.addMasterPage(oMasterPage1);
    //   .addMasterPage(oMasterPage1);
      //add the detail pages to the splitapp control
      oSplitApp.addDetailPage(oDetailPage2);
      //oSplitApp.setInitialDetail("detail");
      //oSplitApp.setInitialMaster("master");
      oSplitApp.placeAt("body");
      </script>
      </head>
      <body class="body">
      <div id="body">
      </div>
      </body>
    </html>

  • I would like to know how i can create a bell graph with out using sub VIs, the data that i created consists in 500 readings with values of 0 to 100, i calculated the mean value and standard diviation. I hope some one can help me

    I would like to know how i can create a bell graph with out using sub VIs, the data that i created consists in 500 readings with values of 0 to 100, i calculated the mean value and standard diviation. I hope some one can help me

    Here's a quick example I threw together that generates a sort-of-bell-curve shaped data distribution, then performs the binning and plotting.
    -Kevin P.
    Message Edited by Kevin Price on 12-01-2006 02:42 PM
    Attachments:
    Binning example.vi ‏51 KB
    Binning example.png ‏12 KB

  • Display Repeated Values in a Crosstab - Design Studio 1.2

    I've a report in Design Studio from a Bex query. There are repeated values in few columns which Design Studio 1.2 refuses to display.
    note: I've already unchecked the box "Hide Repeated Key Values" in the query properties of Bex query designer and i'm able to see repeated values when I open the query in Bex analyzer.
    Design studio would not display the repeated values in the crosstab.
    Anyone encountered and fixed a similar issue before?

    Hi Stephen,
    I was not able to resolve this issue, and I had to go ahead with values not being repeated.
    I think this is a limitation of Design Studio with no fix for it in v 1.3 either, unless someone could suggest otherwise.
    Regards,
    Abbas

  • How to create a matrix with constant values and multiply it with the output of adc

    How to create a matrix with constant values and multiply it with the output of adc 

    nitinkajay wrote:
    How to create a matrix with constant values and multiply it with the output of adc 
    Place array constant on diagram, drag a double to it, r-click "add dimension". There, a constant 2D double array, a matrix.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • Average repeated values

    Hello.
    I have a bit of a problem.
    I have a table, essentially a list of two numbers. The first is the “day” of the observation, essentially the number of days since the experiment began. The second is the actual measured value for that observation.
    Day
    Value
    0
    10
    1
    10.1
    2
    12
    2
    11
    3
    7
    5
    8.5
    5
    12
    Unfortunately, this time-series has two problems: firstly, there can be some days which have multiple observations. Secondly, there are some days that are not in the table, and have no observation (missing values, but not in the “blanks in the time series” sense).
    So, to tackle the first problem, I am asking whether anybody can indicate to me a manner of constructing a formula that, whenever it encounters multiple observations for a single day, takes the average of those observations. In the example above, the formula should “notice” that the Day value is repeated twice for 2 and for 5, and for all of those cells (2, 2, 5, 5) put the relative average (11.5 into each new column for 2, and 10.25 for each for 5).
    Then I will go back and weed out all the repeated Day values by excluding all those lines whose number of observations is repeated.
    And then somehow I will tackle the missing-values problem.
    And then maybe I will get around to analysing my data and doing my work.

    Hello
    If I understand it correctly, you may try something like the following tables.
    Data
    A1  day
    A2  0
    A3  1
    A4  2
    A5  2
    A6  3
    A7  5
    A8  5
    B1  value
    B2  10
    B3  10.1
    B4  12
    B5  11
    B6  7
    B7  8.5
    B8  12
    Avg
    A1  day
    A2  0
    A3  1
    A4  2
    A5  3
    A6  4
    A7  5
    A8  6
    B1  average
    B2  =IFERROR(AVERAGEIF(Data::A,A2,Data::B),"")
    B3  =IFERROR(AVERAGEIF(Data::A,A3,Data::B),"")
    B4  =IFERROR(AVERAGEIF(Data::A,A4,Data::B),"")
    B5  =IFERROR(AVERAGEIF(Data::A,A5,Data::B),"")
    B6  =IFERROR(AVERAGEIF(Data::A,A6,Data::B),"")
    B7  =IFERROR(AVERAGEIF(Data::A,A7,Data::B),"")
    B8  =IFERROR(AVERAGEIF(Data::A,A8,Data::B),"")
    Notes.
    Formula in Avg::B2 can be filled down.
    Tables are built in Numbers v2.
    Good luck,
    H

  • Sql sript for Insert of data with repeating values

    It has been a long long time since I had to do write and use any SQL scripts, please forgive the question. I used to use a script to insert values into a table as part of my job. I have forgotten what the script I used was and since lost all my Oracle note books and other DBA material.
    I did a search and went through 30 pages of results, I didn't see what I'm looking for.
    The data is from one large file that is appended at the end and sometimes updated somewhere in the middle of the set which is considered new data. I am not concern with getting the data out of the file, I got that handled but the insert into the table - transactions - is where I'm lost.
    I used to use a script to load the data, about 6 years ago, and it would load the file, exclude the data that was already in the table and insert the new data and the data with the changes.
    The data columns are date, time, reference, transaction code, location, debit amount, fee amount, balance.
    The date repeats but the time and reference values are unique.
    Any help with this script is appreciated.

    Hi,
    welcome to the forum..!
    You can use Oracle's merge statement to (update + insert) data into a table ... if the data exists update it with the new values and if it does not, then insert it.
    Here's a link to get you started...
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9016.htm
    Since, the data is from a file, you could create an external table on the file and directly do a select from the file.
    MERGE INTO bonuses D
       USING (SELECT employee_id, salary, department_id FROM employees
       WHERE department_id = 80) S
       ON (D.employee_id = S.employee_id)
       WHEN MATCHED THEN UPDATE SET D.bonus = D.bonus + S.salary*.01
         DELETE WHERE (S.salary > 8000)
       WHEN NOT MATCHED THEN INSERT (D.employee_id, D.bonus)
         VALUES (S.employee_id, S.salary*0.1)
         WHERE (S.salary <= 8000);in the above example, the
    SELECT employee_id, salary, department_id FROM employeesis the source data. instead of loading the file into a temporary table and then merge into the target table , you could read from <<<external_table_on_your_file>> and then do a merge into the target table.
    http://www.oracle.com/technology/products/oracle9i/daily/sept19.html
    If you encounter any problems, please post the full description of your error.
    Thanks,
    Rajesh.
    Please mark this/any other answer as helpful or answered if it is so. If not, provide additional details/feedback.
    Always try to provide create table and insert statements to help the forum members help you better.

  • Avoid repeating values in details section

    Hi,
    I have a report with a lot of formulas - depending on certain values in a certain Oracle database table values are summed up.
    The fields are therefore placed in the report footer.
    As I now have to insert a grouping I need to move the fields into the details section. However, I don't want to display each value there but only the sum - I would like to avoid repeating values in the details section.
    A formula looks like this:
    stringvar A1;
    if {OUR_TABLE_FIELD} = 1 then A1 := {OTHER_TABLE.OTHER_FIELD}
    Else A1:=A1;
    A1;
    Thanks!

    Add a suitable group and then display data in this group footer, suppress detail section. It will effectively show the last detail line and thus eliminate duplicates from view. However, data is still there so if you want to use summaries you will need to use Running totals to ensure duplicates are not counted/summed
    Ian

  • XMLAGG repeating values

    Hello, I've just started working with xml and am trying to merge 2 xml documents into a single document.
    The XmlAgg query is repeating the some of the data from the first xmltable.
    I've created a small example of what I am trying to do (is very basic example)
                Select  XMLELEMENT("Questionaire",
                          Xmlagg(
                            XMLELEMENT("Questions",
                              Xmlconcat(
                                Xmlforest(Question_Nbr As "QuestionNumber"
                                        , Question_Type As "QuestionType"
                                        , Question_Asked As "QuestionAsked")
                                        , Xmlelement("QuestionAnswer",Question_Ans)
                                       ))Order By Id)) QT
                From (Select Qt.Id, Qa.Question_Nbr, Qt.Question_Type, Qt.Question_Asked, Qa.Question_Ans
                      From Xmltable ('/Test/Questions/question' Passing Xmltype('<Test><Questions><question><type>general</type><asked>Are you ok</asked></question><question><type>specific</type><asked>Do you know why not working</asked></question></Questions></Test>')
                              COLUMNS
                                  Id For Ordinality
                                , Question_Type Varchar2(100) Path 'type'
                                , Question_Asked varchar2(100) path 'asked') Qt
                      inner join   XMLTABLE ('/Results/question' PASSING XMLTYPE('<Results><question><nbr>1</nbr><ans>Yes</ans></question><question><nbr>2</nbr><ans>No</ans></question></Results>')
                              COLUMNS
                                  Id For Ordinality
                                , Question_Nbr Number Path 'nbr'
                                , Question_Ans varchar2(100) path 'ans') Qa
                      ON Qt.Id = Qa.Id);produces the following: QuestionNumber is 2 in both Questions/QuestionNumber (more nodes = more repeated values)
    <Questionaire>
      <Questions>
        <QuestionNumber>2</QuestionNumber>
        <QuestionType>general</QuestionType>
        <QuestionAsked>Are you ok</QuestionAsked>
        <QuestionAnswer>Yes</QuestionAnswer>
      </Questions>
      <Questions>
        <QuestionNumber>2</QuestionNumber>
        <QuestionType>specific</QuestionType>
        <QuestionAsked>Do you know why not working</QuestionAsked>
        <QuestionAnswer>No</QuestionAnswer>
      </Questions>
    </Questionaire>Running the inner query produces 2 rows with the correct data.
    Select Qt.Id, Qa.Question_Nbr, Qt.Question_Type, Qt.Question_Asked, Qa.Question_Ans
                      From Xmltable ('/Test/Questions/question' Passing Xmltype('<Test><Questions><question><type>general</type><asked>Are you ok</asked></question><question><type>specific</type><asked>Do you know why not working</asked></question></Questions></Test>')
                              COLUMNS
                                  Id For Ordinality
                                , Question_Type Varchar2(100) Path 'type'
                                , Question_Asked varchar2(100) path 'asked') Qt
                      inner join   XMLTABLE ('/Results/question' PASSING XMLTYPE('<Results><question><nbr>1</nbr><ans>Yes</ans></question><question><nbr>2</nbr><ans>No</ans></question></Results>')
                              COLUMNS
                                  Id For Ordinality
                                , Question_Nbr Number Path 'nbr'
                                , Question_Ans varchar2(100) path 'ans') Qa
                      ON Qt.Id = Qa.IdQUESTION_NBR | QUESTION_TYPE | QUESTION_ASKED | QUESTION_ANS
    1 | general | Are you ok | Yes
    2 | specific | Do you know why not working | no
    database version:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    "CORE     11.1.0.7.0     Production"
    TNS for Linux: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    Can anyone point out where my query has gone wrong.
    Thanks
    Mike.

    Hi Mike,
    Your query is OK and I don't reproduce on versions 10.2.0.5 and 11.2.0.2, so unless you're not telling us everything it must be a bug in your version.
    I'm just stabbing in the dark but try removing XMLConcat, you don't need it here :
    Select XMLELEMENT("Questionaire",
             Xmlagg(
               XMLELEMENT("Questions",
                 Xmlforest(Question_Nbr As "QuestionNumber"
                         , Question_Type As "QuestionType"
                         , Question_Asked As "QuestionAsked"
                         , Question_Ans as "QuestionAnswer")
                ) Order By Id
            ) QT
    From (
    ...Alternatively, a single XQuery should do the job too :
    SQL> SELECT XMLSerialize(document qt as clob indent) qt
      2  FROM XMLTable(
      3  '<Questionaire>
      4   {
      5     for $i at $qn in $qst/Test/Questions/question
      6       , $j at $rn in $res/Results/question
      7     where $rn = $qn
      8     return element Questions {
      9       element QuestionNumber {data($j/nbr)}
    10     , element QuestionType   {data($i/type)}
    11     , element QuestionAsked  {data($i/asked)}
    12     , element QuestionAnswer {data($j/ans)}
    13     }
    14   }
    15   </Questionaire>'
    16    passing xmltype('<Test>
    17   <Questions>
    18    <question><type>general</type><asked>Are you ok</asked></question>
    19    <question><type>specific</type><asked>Do you know why not working</asked></question>
    20   </Questions>
    21  </Test>') as "qst"
    22  , xmltype('<Results>
    23   <question><nbr>1</nbr><ans>Yes</ans></question>
    24   <question><nbr>2</nbr><ans>No</ans></question>
    25  </Results>') as "res"
    26  columns qt xmltype path '.'
    27  );
    QT
    <Questionaire>
      <Questions>
        <QuestionNumber>1</QuestionNumber>
        <QuestionType>general</QuestionType>
        <QuestionAsked>Are you ok</QuestionAsked>
        <QuestionAnswer>Yes</QuestionAnswer>
      </Questions>
      <Questions>
        <QuestionNumber>2</QuestionNumber>
        <QuestionType>specific</QuestionType>
        <QuestionAsked>Do you know why not working</QuestionAsked>
        <QuestionAnswer>No</QuestionAnswer>
      </Questions>
    </Questionaire>

  • How do I give a letter a value and use that letter as a code througout a spredsheet?

    Hi I am trying to write a spread sheet to calculate the cost of repairing stock items. I cant figure out how to make the code = the cost, so that if somone types Hx3+Tx2+rx1 it would  = £8
    Which would mean: 3 x Hooks need replacing 2 x Tabs need replacing and 1 5cm rip needs repairing.
    SO I have made one table with the codes and the values and one table for the items and their various panels that may need repairing but I cant figure out how to make it work...?
    Can any of you help...?

    HI Mich,
    Here's an idea of the complexity of the issue, using the example in line 41:
    Issue 1: determining what is code, what is quantity, and how many items are in each cell.
    In the first cell, the formula has to determine, from the text string "Rx1 rx3" that:
    There are two items. Possible to do this by counting the spaces and adding 1, or, assuming ALL parts in the cell will contain a x sign, by counting the "x" characters..
    The first letter is code. But the code could also be the first two letters, or the first two letters plus a number (eg. WP5) or the first two letters plus the next two characters (eg. WP11). Other code lengths may also be possible. The length of the (first) could be determined using SEARCH to find the first x. Subtract 1 from that to determine the number of characters in the code, then use LEFT to extract the code from the formula.
    =LEFT(B2,SEARCH("x",B2,)-1)
    Now that the code has been extracted, that formula becomes the first argument of the VLOOKUP formula from the previous post, used to find the price of that item:
    VLOOKUP(LEFT(B2,SEARCH("x",B2,)-1),Price List :: B:C,2,FALSE)
    Next, the price must be multiplied by the number following the x. That number must be extracted. Assumption: The number is a single digit, between 1 and 9, inclusive. We can use MID:
    MID(B2,SEARCH("x",B2,)+1,1)
    =VLOOKUP(LEFT(B2,SEARCH("x",B2,)-1),Price List :: B:C,2,FALSE)*MID(B2,SEARCH("x",B2,)+1,1)
    The result above gives the cost for repairing the large rip in B2
    Next, if there is more than one type of repair to be done, the process above must be repeated with a new twist: This time we're looking for the second repair item in B2. The marker is a space, so we'll need to add a SEARCH for the first space, and use that as the starting point for both SEARCH functions in this section.
    Then the whole process (with another SEARCH added to each set) must be repeated for the third (possible) code and number in the cell.
    Repeat 7 for as many items as could be included in this cell.
    We don't know how many items will be recorded in each cell, so we have to allow for a maximum and provide some means of making the formula quit when there's nothing more to be done. This could be an IF, depending on the count of "x" or " " in the cell, or an IFERROR that would trap the error caused by searching beyond the last space. Whatever we used would need to be added to each iteration of the last formula shown above.
    As you can see, this quickly becomes a bit unwieldy, and a reason for my earlier suggestion to set up pairs of columns for each repair item.
    Regards,
    Barry

Maybe you are looking for

  • Itunes wont open - Error 7 (windows error 127)

    When downloading the lastest version of itune my computer crashed and now itunes will not open. It says itunes was not installed correctly. Please reinstall. Error 7 (windows error 127). Reinstalling intunes has not fixed the problem. Please help!

  • Time Zone Bugs In 10.10.2

    I still have time zone troubles in Apple Calendar. I have a few events that were sent to me in Outlook for an 11:00 AM PST start time that are showing in Calendar as starting at 11:00 AM CST. On my iOS devices (running the latest versions) they appea

  • Stored proc to pull data from INV/OM/ASCP and load into a user interface

    i'm trying to pull the data from inv, om and ascp into a user interface ? help me write a stored proc to write 3 procedures, with 3 custom tables for the 3 diff source systems i.e., OM/INV/ASCP and also provide these 3 programs in the request set so

  • X86 Install failure on Dell Laptop

    I'm quite familiar with Solaris 8 and have done numerous installs including dual boot on x86, and jumpstarts on Ultras. I am trying to install x86 on a Dell CPX H500gt laptop. 5 gigs space, 256 mb ram. Plenty of resources. No problems with setting up

  • What table to find list of CREDIT MEMO REQUEST?

    Hello people, I was a given an assignment that deals a lot with Credit Memo request. Just a little help to get me started but what table in SAP can I attain this. Thanks guys and take care.