RANK of an item

Hi Guys,
I have a query on the rank function.
select "ProdHier"."prod_fam_name",rank() over (order by sum("Sales"."units_sold") desc) from "Sales", "ProdHier" where ("Sales"."prod_num" = "ProdHier"."prod_num") group by "ProdHier"."prod_fam_name"
gives me
PROD_FAM_NAME rank() over (order by sum("Sales"."units_sold") desc)
adult 1
accessory 2
child 3
now what if i want to know the rank of accessory alone...
expected output
prod_fam_name rank
accessory 2
Thanks,
Vivek

Hi,
I think what Arun means is:
SELECT  *
FROM
(   -- Your original query is below
select "ProdHier"."prod_fam_name",rank() over (order by sum("Sales"."units_sold") desc) from "Sales", "ProdHier" where ("Sales"."prod_num" = "ProdHier"."prod_num") group by "ProdHier"."prod_fam_name"
)   -- You original query is above
WHERE   "prod_fam_name" = 'accessory';Analytic functions (such as RANK) are evaluated after the WHERE clause; that's why you have to put your original query in an in-line view.

Similar Messages

  • Org Rank of three hundred user stories were changed simultaneously

    I found that Org Rank of three hundreds user stories were changed. But i didn't change them one by one.
    Is that possible that Org Rank of the three hundreds user stories were changed simultaneously?

    Hi Layla,  
    Thanks for your post.
    What’s the version of your TFS? Your current team project created using default Agile process template?
    This Org Rank is work item field? If yes, it’s a default field or custom field in your User Story work item? View the work item History control, check which user change that field value.
    And you can refer to the information in this article:
    http://blogs.msdn.com/b/visualstudioalm/archive/2014/05/14/behind-the-scenes-the-backlog-priority-or-stack-rank-field.aspx
    And the answer reply in this post:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/71984af3-f78f-44a7-a2b7-5a54781a5db2/tfs-2012-priority-being-changed-through-web-browser?forum=tfsgeneral.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Pagination with pl/sql region.

    Hi all,
    I have created one more sample page with pl/sql region
    workspace: srijaks
    login:[email protected]
    password:srijakutty
    Application: 49471 - Sample Field Display
    page 16
    Initially it will display the first two records of the concerned department.
    but then by clicking the next and previous buttons it has to display the next two records and the previous 2 records respectively.
    Please, if some one can help me !!!?
    Thanks in advance
    bye
    Srikavi

    Hi Srikavi,
    OK - I've updated your page to get the next/previous buttons working. I have removed the bit in the PL/SQL code that assigned a value to the next button as this was causing me problems. I have also updated the select statement in this to include: and empno >= v('P16_EMPNO').
    The next/previous buttons are based on:
    Previous:
    WITH EMPS AS (SELECT EMPNO, DENSE_RANK () OVER (ORDER BY EMPNO DESC) EMPNUMBER FROM EMP WHERE DEPTNO = :P16_SELECT_DEPT AND EMPNO < :P16_EMPNO ORDER BY EMPNO DESC)
    SELECT NVL(MAX(EMPNO),0)
    FROM EMPS
    WHERE EMPNUMBER = 2Next:
    WITH EMPS AS (SELECT EMPNO, DENSE_RANK () OVER (ORDER BY EMPNO) EMPNUMBER FROM EMP WHERE DEPTNO = :P16_SELECT_DEPT AND EMPNO > :P16_EMPNO ORDER BY EMPNO)
    SELECT NVL(MIN(EMPNO),0)
    FROM EMPS
    WHERE EMPNUMBER = 2These are calculated Before Header and are unconditional
    I have also added an Employees item that is set as:
    {code
    SELECT COUNT(*)
    FROM EMP
    WHERE DEPTNO = :P16_SELECT_DEPT
    This is only calculated when the item is null - which will be the case when a new dept is selected - so this only happens once per selection.  This returns a correct record count - updating the select statement in the report as above, caused problems with the existing count.  Not sure if you want to change these back?
    As you can see, I've assigned a ranking to each item - this could have been achieved using a row number as well.  There are several ways this could have been handled.  The next/previous buttons could be based on the ranking/rownumber value and the EMPNO retrieved based on this.  The EMPNOs could be queried into a collection and you could use the sequence numbers to move through the records.  The above is just one example - you might like to try the others to see which one you prefer.
    Andy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • List view to include a column or field which would display the sequence number in a view

    I have a view for a list which displays items following any condition or sorting. Now, i would like to display the list items in such  a way that
    the auto incremented numbers are displayed as an arbitary field which would display the numbers such that
    its just going to display items in sequence. Is there anything that can be done in sharepoint designer for the list to accomodate a column/field which would display the sequence numbers.
    Thanks

    There are columns such as
    Name, Goals
    and  it should be arranged in descending order of Goals and it could be paginated but also a column should be displayed for ranks e.g
    Name Goals Rank
    A          40     1
    B          39     2
    C          30     3
    So, the idea is the ways it is sorted in descending order, if we possibly have a counter then we could display the ranking of the items.
    Thanks

  • Fastest way to get data from Multiple lists across multiple site collections

    HI
    I need to get data from multiple lists which spread across 20 site collections and need to show it as list view.
    I have searched on internet about this and got some info like options would be to use search core APIs or BCS . I can't use search because I want real time data. Not sure of any other ways.
    if anybody can provide ideas it would be help.

    Might LINQ be an option for you?  Using
    LINQPad and the
    SharePoint Connector, you should be able to write a query that'll retrieve this data, from which you can tabulate it.  I'm not sure how you'd be able to automate this any further so that it's then imported in as list.
    For something more specific, I used a third party tool called the
    Lightning Tools Lightning Conductor, which is essence a powerful content roll-up tool.  In one of my solutions, I created a calculated column that gave an order / ranking on each item, so that when lists were combined, they'd still have some form of
    order.  The web part is also fairly customisable and has always proven a useful tool.
    Hope that helps.
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Relevance of title field in doc library

    Bit of a debate at work and I'm trying to dig up some hard facts.
    We have been told that the title field in a document library and is pointless and can lead to user confusion between title/filename and basically adds no value. There has been recent talk of hiding the title field altogether from forms.
    My concern is the effect this may have on search results.
    We have our own custom meta data fields so this question doesn't relate to collecting meta data - we are covered there.
    I have hunted down some info and have read comments saying that title is second only to content when it comes to the search algorithm. I've also read other articles that are less specific and just say it is good.
    Is there a definitive answer?
    This is a 2010 question but will also apply for our upgrade to 2013 which will be happening soon.
    1. How does the title field feature when ranking results.
    2. Is there a list/URL that defines all aspects of relevance building? 

    Hi ,
    Relevance is about how closely the search results that are returned to the user match what the user wanted to find.
    The formula to calculate relevance uses two areas of ranking called Static and Dynamic ranking.
    Dynamic Ranking (query-dependent ranking) is where the property values or content of an item affects the ranking score. As example the ‘Title’ field can be evaluated against the search criteria and the more important we consider the field
    to be, the higher the ranking score will be for items where the value in the ‘Title’ field have a closer match to the search criteria.
    Static Ranking (query-independent ranking) is where the content or property values of an item do not determine the ranking of the item.
    Dynamic Ranking contains Title Extraction - only performed on Microsoft Office files. In scenarios where the ‘Title’ field of an Office file does not accurately reflect the contents of the item (example when a title of a file is ‘Presentation
    1’ or ‘Document 1’), Enterprise Search detects another candidate for title within the body of the content item, and includes this value with the actual title when calculating relevance.
    More information, please refer to the link:
    http://social.technet.microsoft.com/wiki/contents/articles/20649.sharepoint-2010-improve-search-relevance.aspx
    I hope this helps.
    Thanks,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Wendy Li
    TechNet Community Support

  • Help With Donating Reward? (Adobe Muse)

    The tittle say it all! But i'll just say it easier:
    I host my own minecraft server (bukkit) and i want so people can donate, Thats solved because i made a donating button with paypal so thats done (or if i need to do another way) and im going to put it on my website (like i said if i need another way) and, a screw it!
    If someone could code a plugin that makes so if someone donate through my website they get reward on my server! Maybe a rank and some items...
    EASIER:
    Donate through my website (made with muse) = get reward on server maybe a rank or some items!
    Maybe if someone could code a plugin?
    Please help fast! Thanks, dear Daniel

    What are your questions?

  • Fastest way to get iPod videos from EyeTV?

    I've got an EyeTV 200 hooked up to my MacBook Pro to record TV shows for playback in iTunes and on a video iPod. Right now, I must record the show with the EyeTV, then convert the recording for the iPod. That extra step doubles the time needed to get an iPod-friendly show.
    Can EyeTV record the content directly to an iPod-friendly format? I tried recording in mp4 format and then pulling from the EyeTV recording package just the mpg movie file. But neither QuickTime nor iTunes recognizes the file. VLC does, but that isn't the goal.
    If EyeTV can't do this in one step, is there some other hardware/software combination that will? Elgato's Turbo.264 device seems to simply speed up conversion of already existing video files -- again a two-step process, albeit faster. It would be ideal if it could record and encode for the iPod at the same time.
    Thanks!
    Message was edited by: Steve Porritt
    Message was edited by: Steve Porritt

    Might LINQ be an option for you?  Using
    LINQPad and the
    SharePoint Connector, you should be able to write a query that'll retrieve this data, from which you can tabulate it.  I'm not sure how you'd be able to automate this any further so that it's then imported in as list.
    For something more specific, I used a third party tool called the
    Lightning Tools Lightning Conductor, which is essence a powerful content roll-up tool.  In one of my solutions, I created a calculated column that gave an order / ranking on each item, so that when lists were combined, they'd still have some form of
    order.  The web part is also fairly customisable and has always proven a useful tool.
    Hope that helps.
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Drop ship order logic to select supplier

    Hi,
    I was trying to figure out how supplier is selected for an item if item is not an ASL item or if there are multiple suppliers with same rank for asl item.
    Thanks

    Supplier and Price will default automatically in the Drop Ship Requisition/PO if you try this:
    (1) Create a Sourcing Rule indicating sourcing for the "Buy" item from the given supplier at rank 1 (make sure allocation =100%). Create sourcing Rule Assignment as well.
    (2) Define ASL for the "Buy" Item
    (3) Make sure Item is Checked for Approved Supplier List
    (4) Create a Blanket PO or QUotation and include the item along with its price

  • 0-1 Knapsack

    I had a certain problem and with the help of one of the forum members, I realized it's a typical 0-1 knapsack problem.
    Since I appear to be too dumb to write an algorithm for this myself, I tried finding an already made java implementation.
    I found this:
    http://www.cs.princeton.edu/introcs/96optimization/Knapsack.java.html
    This works surprisingly fast but makes mistakes. I'm quite sure the indices are wrong because it often skips the first entry or something... I also found this:
    http://www.dcs.gla.ac.uk/~pat/52233/l08.html
    It works correctly but SUPER slow.
    So, please people, is your brain works better than mine, take a look at the code and help me get a fast and normally working one...

    prometheuzz wrote:
    jadespirit wrote:
    Good point. The idea is to fill as much space as possible.Ok, what you are now doing is go through all possible combinations. When you have 30 files (or directories), your cycling through 2^30 possible combinations. IMO there is little gain in finding a better "fit" when you've found a couple of file that are together 4450 MB's. So, to improve the runtime, you could break out of the algorithm when you've found a solution that is only X MB's away from an optimal one.
    Good luck.I read this thread with great interest (for some reason I feel attracted to these filthy NPC problems ;-) but I don't like those quantitative heuristics; I fiddled a bit and dusted off an old hack from my bag of tricks; it divides the problem space in two parts w.r.t. a certain item in the problem set: that item either belongs to an optimal solution or it doesn't. If the items are ordered in ascending order of weight the first items are sort of 'better' than the next items to be part of the optimal solution.
    If an item to be considered to be part of the solution is heavier than the total remaining capacity of the knapsack, that particular item and all the next item can't be part of the current solution. If a solution without an item is better than a solution with that item the first solution is a better candidate to be an optimal solution.
    The following little hacky classes implement the above notions and it finds an optimal solution (30 items) within seconds after searching - 50,000 possibilities and cutting off - 50% of them; here it is:
    import java.util.Scanner;
    import java.io.*;
    public class Knapsack {
         private Item[] items;
         private int nofItems, capacity;
         private void initialize() throws FileNotFoundException {
              Scanner input= new Scanner(new File("/tmp/data.txt"));
              capacity= input.nextInt();
              nofItems= input.nextInt();
              items= new Item[nofItems];
              for (int i= 0; i < nofItems; i++)
                   items= new Item(input.nextInt(), input.nextInt());
              total= 0L;
              cut= 0L;
         private Solution solve(int allowed, int cap) {
              Solution take, dontTake;
              if (allowed < 0)
                   return new Solution(nofItems);
              total++;
              dontTake= solve(allowed-1, cap);
              if (items[allowed].weight > cap) {
                   cut++;
                   return dontTake;
              take= solve(allowed-1, cap-items[allowed].weight).take(items, allowed);
              return (take.value > dontTake.value)?take:dontTake;
         private long total;
         private long cut;
         public static void main(String[] args) throws FileNotFoundException {
              Knapsack k= new Knapsack();
              k.initialize();
              Solution b = k.solve(k.nofItems-1, k.capacity);
              System.out.println("Total Value: " + b.value);
              System.out.println("Total Steps: " + k.total);
              System.out.println("Total Cuts : " + k.cut);
              for (int i= 0; i < k.nofItems; i++) {
                   if (b.taken[i]) {
                        System.out.println(i + ": " + k.items[i]);
    class Solution {
         boolean[] taken;
         int value;
         Solution(int nofItems) {
              this.taken= new boolean[nofItems];
         Solution take(Item[] items, int rank) {
              this.value+= items[rank].value;
              this.taken[rank]= true;
              return this;
    class Item {
         int value, weight;
         public Item(int value, int weight) {
              this.value= value;
              this.weight= weight;
         public String toString() {
              return value + " " + weight;
    This thing reads a data file with the following format: capacity nofItems items*, where each item consists of two numbers: its value and its weight.
    kind regards,
    Jos                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Adobe Muse: PayPal

    The tittle say it all! But i'll just say it easier:
    I host my own minecraft server (bukkit) and i want so people can donate, Thats solved because i made a donating button with paypal so thats done (or if i need to do another way) and im going to put it on my website (like i said if i need another way) and, a screw it!
    If someone could code a plugin that makes so if someone donate through my website they get reward on my server! Maybe a rank and some items...
    EASIER:
    Donate through my website (made with muse) = get reward on server maybe a rank or some items!
    Maybe if someone could code a plugin?
    Please help fast! Thanks, dear Daniel

    That wasn't that i mean't! Read again!
    I mean't:
    EASY:
    Donate through Paypal and you'll get a reward on my server (minecraft bukkit server)
    HARD:
    I make a button through paypal maybe, donation button, if someone press it they will donate to me and then they get a reward in my server! Like buycraft!
    But i already use it but i can only have a limit ranks to sell, i dont wanna buy premium! I though about like enjin! (That shop is made with enjin but that i'll need to pay for that to) So i use Muse and asking for help now =/
    So like this, code a bukkit plugin that knows who donated and then they'll get in-game reward!

  • Need to pull ranked item from one query into new query

    Hi,
    I have a parent query in which I assign a rank to characteristic values based on a key figure, in dollars. I need to pull the top 4 items from that parent query into 4 seperate child queries (i.e. child query 1 is written based on ranked item 1, child query 2 is written based on ranked item 2, etc.) Does anyone have any ideas how to achieve this?
    Thanks
    CM

    Hi,
    I have a parent query in which I assign a rank to characteristic values based on a key figure, in dollars. I need to pull the top 4 items from that parent query into 4 seperate child queries (i.e. child query 1 is written based on ranked item 1, child query 2 is written based on ranked item 2, etc.) Does anyone have any ideas how to achieve this?
    Thanks
    CM

  • Need to pull ranked item from query into new query

    Hi,
    I have a parent query in which I assign a rank to characteristic values based on a key figure, in dollars. I need to pull the top 4 items from that parent query into 4 seperate child queries (i.e. child query 1 is written based on ranked item 1, child query 2 is written based on ranked item 2, etc.) Does anyone have any ideas how to achieve this?
    Thanks
    CM

    Here's what I ended up doing to resolve this...
    Created a Parent_Query that pulled all the results. No conditions or replacement path variable.
    Created a Parent_Query_Top_4 with a condition "Top N: 4". Since I am using a Structure in my rows, I had to create a formula in the structure called "All" to get the condition to work. So in the condition, I selected my Key Figure "Cost", the Structure element "All" " (if you are using a structure in a condition, you're forced to select one of the structure elements), the condition "Top N" and the number "4". I also had to go to the Characteristic Assignment tab and select "Individual Chars and Char Combinations" with my "Code Group" characteristic selected, since I am only interested in seeing the Top 4 Code Groups and didn't want my query to consider any of the other characteristics.
    Created Child_Query_Top_2. Restricted my Code Group characteristic to a replacement path by query variable. I replaced it with the results from Parent_Query. I then placed a condition on this query for Key Figure "Cost", the Structure element "All" the condition "Top N" and the number "2"; "Individual Chars and Char Combinations" with my "Code Group" characteristic selected.
    Created Child_Query_Top_3. Restricted my Code Group characteristic to a replacement path by query variable. I replaced it with the results from Parent_Query. I then placed a condition on this query for Key Figure "Cost", the Structure element "All" the condition "Top N" and the number "3"; "Individual Chars and Char Combinations" with my "Code Group" characteristic selected.
    Created Child_Query_1. This will find the #1 highest Code Group. Restricted my Code Group characteristic to a replacement path by query variable. I replaced it with the results from Parent_Query. I then placed a condition on this query for Key Figure "Cost", the Structure element "All" the condition "Top N" and the number "1"; "Individual Chars and Char Combinations" with my "Code Group" characteristic selected.
    Created Child_Query_2. This will find the #2 highest Code Group. Restricted my Code Group characteristic to a replacement path by query variable. I replaced it with the results from Child_Query_Top_2. I then placed a condition on this query for Key Figure "Cost", the Structure element "All" the condition "Bottom N" and the number "1" (to get #2 item in the top 2); "Individual Chars and Char Combinations" with my "Code Group" characteristic selected.
    Created Child_Query_3. This will find the #3 highest Code Group. Restricted my Code Group characteristic to a replacement path by query variable. I replaced it with the results from Child_Query_Top_3. I then placed a condition on this query for Key Figure "Cost", the Structure element "All" the condition "Bottom N" and the number "1" (to get #3 item in the top 3); "Individual Chars and Char Combinations" with my "Code Group" characteristic selected.
    Created Child_Query_4. This will find the #4 highest Code Group. Restricted my Code Group characteristic to a replacement path by query variable. I replaced it with the results from Parent_Query_Top_4. I then placed a condition on this query for Key Figure "Cost", the Structure element "All" the condition "Bottom N" and the number "1" (to get #4 item in the top 4); "Individual Chars and Char Combinations" with my "Code Group" characteristic selected.
    Very roundabout, but fulfills the request for these very dynamic reports. And once one is done, all you really need to do is copy that one and keep changing the conditions and/or replacement path variables. Now I'll stick it all in a workbook and VOILA!
    Hope this can help someone sometime...
    C

  • Open item Settlement for exact match.

    Hi All,
    We have requirement in our project to clear the exact match first ahead of the oldest due debt.
    To elaborate on the requirement, please have a look at the following example.
    1st Invoice -$100  Due date-1/11/2010
    2nd Invoice-$250  Due date-1/12/2010
    Customer makes a payment of $250 on 10/12/2010.
    As per our requirement, It should clear the 2nd Invoice first, as it gets an exact match and not the oldest debt due.
    However, if the customer makes a payment of say $300, then it does not find any exact match and hence will clear the oldest due first.In this case,the 1st invoice.
    In the clearing Step under the clearing variant , we have tried to use the Amount rule as '0'-Clearing only possible when amounts are same.....but it is not working as per our requirement.
    Can any one of you give any thoughts on the issue?
    Thanks,
    Amlan

    Hi - tried this config, and I cleared an open item based on exact amount, that was due later that 2 other items. See below.
    Ivor Martin
    Clearing Var.   ZEX  Exact matching test
    Clearing Step   1    Exact match on amount
       Char.                    Grpng rule    Sort charact.           Rank     Sort
    1. 013  Open Amount Without In          1.
    2.                                      2.
    3.                                      3.
    4.                                      4.
    5.                                      5.
      Amount Rule     0
      Clearing rule                                  Paymt rem. var.  ZEX / 2
                                                     End of assgmt
                                           / 0
    Clearing Step   2    Oldest due date
       Char.                    Grpng rule    Sort charact.           Rank     Sor
    1. 015  Contract Account                1. 010  Due date
    2.                                      2.
    3.                                      3.
    4.                                      4.
    5.                                      5.
      Amount Rule
      Clearing rule                                  Paymt rem. var.      / 0
                                                     End of assgmt    9
                                           / 0

  • Single Item drop down (View, Edit, Delete, Alert) on Companyweb List (2003)

    We had a user delete an old list that was created by a previous technician. I recreated the list as best I could but I noticed the previous one had a drop down on the first column and I don't see that anymore. The drop down had (View, Edit, Delete, Alert)
    each item in the first column would have this.

    Kris,
    Go to "Modify settings and columns" 
    select the column named "Title (linked to item with edit menu)" and rank it as first column
    like below
     You will get (View, Edit, Delete, Alert)
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

Maybe you are looking for