Sorting records with property values

Hi Friends,
Can anybody please suggest a solution/approach for this requirement?
Lets say,I have 100 records displayed in a non-search results page which are inter-related but they have 2 different inventory properties ex:online_inventory and store_inventory.We are sorting the products by online_inventory property and we are seeing the products displayed in the following order:
online_instock items--->online_outofstock items--->store_instock items--->store_outofstock items.
Now,our requirement is to show the products in following order:
online_instock items--->store_instock items--->online_outofstock items--->store_outofstock items.
The basic idea is to push the out of stock items at last irrespective of whether it is an online or store product?
Please note that due to some limitations,we cannot maintain a single inventory property combining online and store inventories.
Is it possible to apply a sort key here based on a property value or how can we achieve this requirement?
Regards
Shreyas

Shreyas,
You can do it another way :
Create a Property say P_combain_sort and enabled for sort, add a manipulator for retrieving the value of online_instock and store_instock.
check if online_instock  and store_instock value is 1 then add source property combain_sort and its value 1 otherwise 0 with record.
In Property mapper map property combain_sort to P_combain_sort and apply sort in newly created property.
Hope this will help you.
Thanks,
Sunil

Similar Messages

  • Dropdown with property values

    Hi Experts,
    How would you create a drop down on a report which contains all the values of a property for a given dimension.
    My Account dimension has property called Allocation_Rule  which could have Rule1, Rule2 ... values.
    In my report i have to give the rule selection to the user so that when they pick a value i will have to expand evdre rows for  accounts where the property is Rule1 or so.
    Question 1:  How would you create that dynamic drop down with property values
    Question 2: How would you expand EVDRE based on the drop down selection.
    AD

    Hi,
    A fairly simple way to do this would as follows:
    1) Build an EVDRE on a hidden sheet, have all BASMEMBERS of the dimension you require in rows
    2) Have EVPRO on each line of this EVDRE returning the property you require (=EVPRO(<APP NAME>,<CELL REF>,<PROPERTY NAME>)
    3) On the main sheet have a cell (say in B1) with data validation (List), pointing to the EVPRO column of your hidden EVDRE
    This will return all of the available property values in the dropdown box.
    4) In the Expansion range of your main report enter something like ="BASMEMBERS AND <PROPERTY NAME>="&B1
    Then based on what you pick from the drop-down box your report will refresh with.
    Hope this helps.
    Tom.

  • Sorting for second property value?

    We have implemented a property read filter to set a value for a property SORT_ID.
    This works fine and the collection list renderer is customized to take the SORT_ID as "property for sorting". As fas as good.
    Our problem:
    In case the SORT_ID is identical, the list is not always sorted by name or ID as we suppose.
    Why? Is there any hint to get that going or is any implementation neccessary?
    Thanks for your help
    Helge

    Hi Helge,
    it's the same as with every other (standard) property - you can only sort by one property. If the sort_id property is not fine grained enough, it's a problem of the implementation of this property that it is able to return the same value for different resources. If you would add the name or the ID of the resource into the sort-id itself, this should do the trick (for example, have resources aaa and bbb; your sort-id calculates "5.5" for both resources; if your sort id would be created like "5.5_aaa" and "5.5_bbb", it would sort in first place for the sort-id, and after that for the name of the resource).
    Also see Collection renderer - Property for sorting (your own thread), Sort Multiple Properties and Sort Multiple Properties
    Hope it helps
    Detlev
    PS: Please consider rewarding points for helpful answers on SDN. Thanks in advance!

  • Purchase info record with same values

    Hi,
    I want to create purchase info records with the same material vendor purchasing org. plant ,how can it be done.
    This is required because it is possible for the same vendor to deliver material for the same plant and purchasing organisation.Is there a workaround or any reason for this.
    Regards

    In SAP , this is not possible to have 2 different inforecords for the combinaiton of MaterialVendorPur orgPlantinfo record type
    could you please explain more regarding the requirement ....
    Regards
    Mani

  • Populate Parent/Child records with "Family" value

    Hi,
    I typically do the task I'm asking assistance with in Excel and it works great... the only problem is that it's VERY slow and takes a lot of work when over 1 million rows as you must split it up and yeah just painful! But what I'm trying to accomplish is
    pretty straight forward for Excel, however escapes me in T-SQL! I have an ordered number that is sorted asc. I have a flag that indicates a record is the "Parent". I want to update the family value for the "Parent" and all sequential records
    until the next "Parent" records is reached. So here is an example in Excel.
    Using the following formula in cell C2 and pasting all the way to the last record, I can easily(for smaller sets anyway) create my desired results.
    =IF(B2="Y",A2,C1)
    Number Flag Family
    1 Y 1
    2 1
    3 1
    4 1
    5 1
    6 1
    7 1
    8 1
    9 Y 9
    10 9
    11 Y 11
    12 11
    13 11
    14 Y 14
    15 14
    16 14
    17 14
    18 14
    19 14

    I have an article on this exact topic
    Fixing
    Missing Data Based on Prior Row Information
    It shows the concept of using OUTER APPLY to achieve desired functionality.
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles
    I wish I knew how to apply this OUTER APPLY solution to an update statement so I could use. Would this be more efficient and faster than the solution provided by RyanAB? I have millions of records and NOT enough time... the fastest solution is definitely desired!!!
    I ended up using this as a solution as it was the fastest. I first did:
    SELECT a.Number, M.Number 'Family' into FamilyTable FROM Table a
    OUTER APPLY (
    SELECT TOP (1) *
    FROM Table b
    WHERE a.Number >= b.Number and b.[Flag] = 'Y'
    ORDER BY b.[Number] DESC) M
    ORDER BY 1, 2
    Then updated the original like so:
    update a set a.Family = b.Family
    FROM Table a inner join FamilyTable b
    on a.Number = b.Number
    Thanks to all!!!

  • How to suppress records with vzero value in a union report in OBIEE?

    Hi
    I have a Union report ,Rep1 union Rep 2,with a cloumn A in rep1 and a dummy column in place of column A in rep 2.
    I want to restrict the records where A= 0 in the union report.
    How to go abouth this.
    Thanks in advance !!

    hi,
    In report1 let the column be as it is ,why are you changing the f(x) to case statement.Did you check is data there in that column of report1.
    In the union report make tat dummy column as 0 or 1 accordingly as per your requirement.So it would retrieve all the values of column of report1.
    Check the join conditions established and play with the joins like give a full outer join and check if the data is coming including 0's if so then you can pply filter on that column saying column not equal to 0,so the remaining values gets populated.
    Cheers,
    KK
    Edited by: Kranthi.K on May 18, 2011 2:03 AM

  • How to create new record with old values

    Dear all
    i have creation page with 45 fields are there
    user will enter all the fields and save it will call to non editable mode
    if user will click on change button it will call to editable mode
    in that my requirement is user wont change among those ites(45 items)clcik on save again it will call to view mode
    in that user will change any one of the value among 45 items and click on save button i need to create one more record in database
    if user wont edit any one of the field out of 45 items i dont want to create new record in database
    how can we achieve thsi functionality
    Regards
    Sreekanth

    Hi Srikant,
    When user may edit the record, the same row may get updated in vo. Thus over writing existing row instead of creating new row.
    Approach1..
    On the page where user may edit records, instead of presenting records of existing row, present copy of existing row. So
    In AM... (Later on you can put vo logic to its proper place, i.e. vo java file)
    public void viewPageCallSetup()
    Row originalRow=vo.createRow();
    Row dummyRowForEdit=vo.createRow();
    //COPY THE ORIGINAL ROW TO DUMMY ROW. IF THERE IS DIRECT METHOD TO CREATE COPY OF EXISTING ROW, THAT MAY BE MUCH BETTER.
    for(int i=0;i<vo.getAttributeCount()-1; i++)
    dummyRowForEdit.setAttribute(i, originalRow.getAttribute(i));
    vo.insertRow(dummyRowForEdit);
    vo.setNewRowState(Row.STATUS_INITIALIZED);
    vo.setCurrentRow(dummyRowForEdit);
    call this method in contoller's processRequest..
    string oid=pagecontext.getparameter("oid");
    if(pageContext.getparameter("Purpose").equals("Edit")) //Means user clickED the edit button so we need to replicate the row
    am. viewPageCallSetup(oid); //calling this method in am
    else
    In PFR...
    if(pageContext.getparameter("Purpose").equals("Edit"))
    am.xxcostedit(oid); //calling this method in am
    in case user selects "Cancel" on edit form,we need to remove the duplicate row. So in AM write a method to remove the duplicate rowd on click of "Cancel" button on edit form.
    Rest of the logic is same for "Save" button. Just say commit.
    Abdul Wahid

  • How to develop this report/Query that selects records with MAX Value

    Hi,
    My requirment is to develop a report to show all emp whose policy is going to expire ith in the user selected date intreval...
    Emp_ID--App_Date-Policy_Strt_Date--Policy_End_Date--App_Status
    101.01.2007---BlankBlank--
    NEW   (New application for a Medical Insurance policy raised for employee)
    101.01.2007---01.02.200730.05.2007--
    COMPLETE (policy issued for emp with strt & end dates)
    115.05.2007---01.02.200730.05.2007--
    RENEWAL  (a application is raised to renew emp policy)
    115.05.2007---01.06.200731.12.2007--
    COMPLETE  (policy issued for emp with strt & end dates)
    115.12.2007---01.06.200731.12.2007--
    RENEWAL  (a application is raised to renew emp policy)
    115.12.2007---01.01.200831.05.2008--
    COMPLETE  (policy issued for emp with strt & end dates)
    115.05.2008---01.01.200831.05.2008--
    RENEWAL  (a application is raised to renew emp policy)
    115.05.2008---01.06.200831.05.2009--
    COMPLETE  (a application is raised to renew emp policy)
    So EMP 1 got valid policy untill 31.05.2009.
    When a user executes a query to show all employees whose policy expiry date intreval (01.05.2008 to 31.05.2008)
    it shouldn't show Emp 1 as he got  valid policy untill 31.05.2009  but currently it is showing Emp 1....
    How can i achieve this
    Thanks

    Hi
    Thanks for the update
    I created variable on Plc End end
    If user enter show all emps whose policy is expiring in MAY (01.05.2008---31.05.2008) it is displaying EMp 1 as well but emp 1 has a policy which expires in 2009
    Thanks

  • Three record with maximum values

    I have followed query:
    select a.deptno a, count(b.empno) b
    from dept a, emp b
    where b.deptno(+) = a.deptno
    group by a.deptno
    and I got a result:
    a b
    10 3
    20 5
    30 6
    40 0
    50 9
    60 4
    70 7
    80 1
    How can I get three departments with largest number of employees?
    I would like to get result like this:
    a b
    50 9
    70 7
    30 6
    Thanks.

    If you have several departments with the same count of employees then a limitation by rownum leads to a undefined result,
    e.g. when department 20 in your eample has also 6 employees, then the answer could be
    a b
    50 9
    70 7
    30 6
    20 6
    use the dense_rank function to get the rank of the departments and then limit to the top three,
    e.g.
    select *
    from (
    select a, b, dense_rank() over(order by b desc) b_rank
    from (
    select a.deptno a, count(b.empno) b
    from dept a, emp b
    where b.deptno(+) = a.deptno
    group by a.deptno
    where b_rank < 4
    ;

  • Sort multiple records with textfield

    Hi everyone!
    I want to sort from the backend all the products in a site.
    First, i use the repeat region server behavior, to list all the products. Added a textfield in each record, with the value of it's position (1, 2, 3, 4, etc).
    How can i update that?
    Just like Joomla! has in it's backend. A list with all the articles created, and the ability to change the order of the articles, changing it's number and pressing "save".
    Hope you guys understand me, my english is very very poor...
    Thanks in advance
    Cheers!
    A pic to better understanding:

    Since you refer to Joomla, I presume you want to do this with PHP/MySQL.
    Basically, you need to put your repeat region in a form, and submit the values of the product IDs and the new order numbers as arrays. To do this with PHP, you add a pair of square brackets after the form elements' names like this:
    <input type="text" name="product_id[]" value="....
    <input type="text" name="order[]" ...
    When the form is submitted, $_POST['product_id'] will contain an array of the primary keys, and $_POST['order'] will contain an array of the values inserted in the order text boxes.
    You then need to create a loop to update the existing records in the database. The following is not the full code, but should show you the basic principle:
    // connect to database
    for ($i = 0, $len = count($_POST['product_id']); $i < $len; $i++) {
        $sql = 'UPDATE products SET order = ' . mysql_real_escape_string($_POST['order'][$i]
               . ' WHERE product_id = ' . mysql_real_escape_string($_POST['product_id'][$i];
        mysql_query($sql);
    This loops through the $_POST['product_id'] array and updates each record with the appropriate value for order. The SQL query assumes that both product_id and order are numeric data types.

  • Bdc while uploading Itab one extra record is coming with 000000 values

    Hi
    am getting one extra record with 00000 values for begda ,endda and object id  dont know why ?
    code is like,
    TYPES : BEGIN OF tt_record,
    plvar  type   hrp1000-plvar,
    otype  type   hrp1000-otype,
    seark  type   hrp1000-objid,
    begda  type   hrp1000-begda,
    endda  type   hrp1000-endda,
    short  type   hrp1000-short,
    stext  type   hrp1000-stext,
    END of tt_record.
    DATA:gt_record TYPE TABLE OF tt_record,
         gs_record TYPE tt_record.
    include bdcrecx1.
    start-of-selection.
    CLEAR : gt_record,gs_record.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'C:\ABC.TXT'
      FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = 'X'
      TABLES
        DATA_TAB                      = gt_record
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Regards
    Meeta

    Hi  Txs for your response  i have created new file and my that problem solved but i want to know when i run in forground then only it works fine and update records but when i try in background it immd turn into incorrect log and when i run in Display error mode  i got these errors in error log,
    Runtime error RAISE_EXCEPTION has occurred
    Transaction error
    Processing statistics
    3 transactions read
    0 transactions processed
    3 transactions with errors
    0 transactions deleted
    Batch input processing ended
    Any idea any one can guide me on this,
    Regards
    Meeta

  • Picking records with distinct col values

    Hi gurus,
    I have a table with
    id col1 col2 col3
    1 a b c
    2 e f g
    3 a b c
    4 a b c
    what would be the query to pick records with distinct col1,col2,col3 values.i.e records with col values 1,a,b,c and 2,e,f,g only in the above table
    Could you please help me on this?
    Best Regards
    Sridha

    SQL> with t as
      2  (
      3  select 1 COL1,'A' COL2,'B' COL3,'C' COL4 FROM DUAL UNION ALL
      4  select 2,'D' COL1,'E' COL2,'F' COL3 FROM DUAL UNION ALL
      5  select 3,'A' COL1,'B' COL2,'C' COL3 FROM DUAL UNION ALL
      6  select 4,'G' COL1,'H' COL2,'I' COL3 FROM DUAL UNION ALL
      7  select 5,'D' COL1,'E' COL2,'F' COL3 FROM DUAL
      8  )
      9  SELECT COL1, COL2, COL3, COL4
    10  FROM T
    11  /
          COL1 C C C
             1 A B C
             2 D E F
             3 A B C
             4 G H I
             5 D E F
    SQL> with t as
      2  (
      3  select 1 COL1,'A' COL2,'B' COL3,'C' COL4 FROM DUAL UNION ALL
      4  select 2,'D' COL1,'E' COL2,'F' COL3 FROM DUAL UNION ALL
      5  select 3,'A' COL1,'B' COL2,'C' COL3 FROM DUAL UNION ALL
      6  select 4,'G' COL1,'H' COL2,'I' COL3 FROM DUAL UNION ALL
      7  select 5,'D' COL1,'E' COL2,'F' COL3 FROM DUAL
      8  )
      9  SELECT COL1, COL2, COL3, COL4
    10  FROM
    11  (
    12  SELECT COL1, COL2, COL3, COL4, ROW_NUMBER () OVER (PARTITION BY COL2, COL3, COL3 ORDER BY COL1) AS RN
    13  FROM T
    14  )
    15  WHERE RN=1
    16  /
          COL1 C C C
             1 A B C
             2 D E F
             4 G H I
    SQL>

  • How to show records with zero on dashboard

    hi expert,
    if I have a dimension table product,
    a fact table
    if in the db, there are records with zero values of product A.
    if the logical column for the fact is SUM(...).
    how to show records with zero values on dashboard.
    Use the outer join?
    or other method?
    I dont wanna use outer join because it makes the PRD be so complicated

    hi,
    Pull all the columns to criteria ,it will show NULL for a product
    To get zero,on the fact column use IFNULL(fact_col,0)
    which will look like this
    http://a.imageshack.us/img180/6616/ifnull.jpg
    thanks,
    saichand.v

  • AppleScript- filtering a list of records by a property value possible?

    How can a list of records like the one below (except each list has 82 items) be filtered by a field's value so that the resulting list contains only records with a given property value?
    e.g.
    set recordList to (*input follows*) {{fnum:1, fname:"Admin", fval:"", isCustom:true},{fnum:8, fname:"Cataloged", fval:"4/18/12 4:04 PM", isCustom:false}}
    I tried:
    items of recordList where isCustom is true
    but instead of the desired result( below) I got "variable isCustom not defined."
    {{fnum:1, fname:"Admin", fval:"", isCustom:true}} --desired result
    Is there a better way to do this than loop through the list and build a new list by evaluating the labeled pair of each record in the list?
    Thanks in advance for any insights.

    Hello Thomas Camilleri,
    Short answer is no.
    Filter reference form is only applicable to application objects and processed by the application.
    Long answer is that you can define some handlers to make code concise though you cannot avoid iteration through the list. After all, even the filter reference form invokes iteration behind the scene, so the ultimate question here would be how well we can hide the iteration from the scene.
    E.g., something like the codes below. Inevitable iteration is hidden in general-purpose handlers map() or match() and you may only define the filter1() or pattern1() handlers for your specific purpose. SCRIPT 2 would be better fit for your object.
    Regards,
    H
    -- SCRIPT 1
    set rr to {{key1:10, key2:true}, {key1:14, key2:false}, {key1:16, key2:true}}
    set rr1 to map(filter1, rr)'s records
    return rr1 -- {{key1:16, key2:true}}
    on filter1(x)
        if x's key2 and x's key1 > 11 then return x
        return missing value
    end filter1
    on map(func, aa)
        script o
            property xx : aa's contents
            property yy : {}
            property f : func
            repeat with x in my xx
                set end of my yy to my f(x's contents)
            end repeat
            return my yy's contents
        end script
        tell o to run
    end map
    -- END OF SCRIPT 1
    -- SCRIPT 2
    set rr to {{key1:10, key2:true}, {key1:14, key2:false}, {key1:16, key2:true}}
    set rr2 to match(pattern1, rr)
    return rr2 -- {{key1:16, key2:true}}
    on pattern1(x)
        x's key2 and x's key1 > 11
    end pattern1
    on match(pat, aa)
        script o
            property xx : aa's contents
            property yy : {}
            property f : pat
            repeat with x in my xx
                set x to x's contents
                if f(x) then set end of my yy to x
            end repeat
            return my yy's contents
        end script
        tell o to run
    end match
    -- END OF SCRIPT 2

  • Xml string as property value in pipeline record

    Hi,
    We want to pass a XML-style string as a property value in the pipeline. but from the reference application, the property did not display, how should we handle such case in the input piplefile? do we need to do any transfamtion or encoding?
    <STORES>
    <RECORD>
    <PROP NAME="store_hours">
         <PVAL><mon><![CDATA[7:00am-11:00pm]]></mon>
         <tue><![CDATA[7:00am-11:00pm]]></tue>
         <wed><![CDATA[7:00am-11:00pm]]></wed>
         <thu><![CDATA[7:00am-11:00pm]]></thu>
         <fri><![CDATA[7:00am-11:00pm]]></fri>
         <sat><![CDATA[7:00am-11:00pm]]></sat>
         <sun><![CDATA[7:00am-11:00pm]]></sun>
    <PVAL>
    </PROP>
    </RECORD>
    </STORES>
    Thanks,
    Bruce Xie
    Edited by: user11899328 on 19/04/2013 13:49

    Well I believe this is not officially mentioned anywhere, but this is the limitations for the java embedding activity. You can assign value to a single variable or to the single part element of variable only. I suggest you go with a java web service. you can check more details on java embedding activity @ http://docs.oracle.com/cd/E21764_01/integration.1111/e10224/bp_java.htm
    void setVariableData(String name, Object value)
    void setVariableData(String name, String part, Object value)
    void setVariableData(String name, String part, String query, Object value)

Maybe you are looking for