Sort descending by a key figure?

Hello,
This question relates to our Top 10 Vendors query. The default version of the report sorts in ascending order for total invoice value. I can change this from the right click context menu to be in descending order, but I can not figure out how to make this the default setting. The properties in the query do not have an option to sort by this key figure in an ascending or descending fashion. Can anyone tell me how to sort by a key figure?
Thanks very much,
Bob

You can make a descending sorting for your key figure using the condition TopPercent (Top%) and take the value 100. To sort ascending, use the BottomPercent (Bottom%) condition on your key figure.
Then 100 % of the values of your key figure will be shown in a descending sorting by default in your query (without using a view).
I used the feature in the newest BEx Query Designer (7.x) and it works fine, I don't know if it's available in the older version (3.x).
Please assign points.
Kind regards,
Ben De Windt
Belgium

Similar Messages

  • How to make data sorted by default by key figure?

    hi experts,
    how to make data sorted by default by key figure?

    Hi ,
    Try to make the selections for the filter of the query..
    Check this link ..
    http://help.sap.com/saphelp_nw70/helpdata/en/f1/0a5625e09411d2acb90000e829fbfe/frameset.htm
    Regards,
    Shikha

  • Key Figure Sorting in Workbook

    Hi Experts,
    I am creating a workbook where the key figures are supposed to be sorted in descending order. I tried using a Condition the displays the Top 100% of the results (because I want to display all, I just want to sort). The condition is working fine during the first run. However, when I save the workbook and re-open it again, the sort does not work anymore. Please advise. Any help is greatly appreciated.
    Thanks,
    Juice

    Hi Juice,
    Why dont you use the key figure sorting property present in the the Bex Analyzer.?
    Steps:
    1.  In analysis mode, select a key figure cell in the analysis grid and access the context menu. This can be done in 2 ways..
    ○       Choose the cell with your right mouse button (secondary mouse button).
    ○       From the menu, choose BEx Analyzer --> Context Menu for Selected Cell
    2. Choose Properties.
    The properties dialog box for the selected key figure appears.
    On the Sorting tab, you can configure the different sort options for the selected key figure.
    Hope this helps you!
    -Pradnya
    Edited by: Pradnya Rane on Mar 24, 2009 5:20 AM

  • Sort Key Figure in a Query

    I have a situation where I have to use a query (not possible to use a view - long story, but limitations on views make it so)
    I have a simple query that has products on rows, and Month and Sales Value on the columns.
    I want to sort the Sales value descending.
    ie
    product   Sales Value/8.2005
    prod1      500
    prod2      400
    prod3      300
    How do I tell the query to sort on the Key figure value descending as shown above???
    I have managed to achieve this by putting a condition on that returns the top 100% of the query, however there must be a better way??? (although I am slowly losing confidence in SAP's thinking (or lack thereof))
    Thanks in advance for any assistance.
    Regards
    Richard

    Hi JKyle,
    Thanks for your response.
    I am aware that you could sort by using the Properties on the context menu of the key figure, but this is no good for a default view without hacking the URL, which becomes quite tedious. (My users are not capable of entering even the simplest of variables, let alone using a context menu to sort every time they run a report.
    You can also bookmark once it has been sorted, however have had problems with bookmarks disappearing in the past, and so I don't really consider this to be a solution either.
    I guess I thought that this was such a fundamental requirement that it would be included, and that I was missing some setting somewhere when developing the query.
    Thanks again for your response.

  • Sorting by Key figure

    Hi Guys
    How can I sort the query by a key figure or calculated key figure when I run the query, I know I can do it by rigth click on the key figure after the query is executed but I want the query to be sorted by the key figure as soon is executed.
    Thanks
    Edited by: Antonio Rodriguez on Jul 2, 2008 11:20 PM

    Antonio,
    Define a new condition and select your key figure and define TOP N where N is very high number let say 10000 for sorting them in ascending order and Bottom N for sorting in descending order.
    do revert back if ur prob is solved.

  • Sort By Key Figure?

    I am using BEx Query Designer to build a query and I have two key figures. I would like to sort the results by one the ascending values of one of my key figures. The output seems to sort it by the characteristics by default. Is there a way to have the query sorted by key figure values instead?

    The default sort option by characteristic only. I don't  think there is an option to sort by key figure.
    However, you can use conditions to display Top N, Botton N, Top %, Bottom % records. For instance you want to show top 10 customer by Sales Amount key figure, crate a condition on sales amount key figure and select the operator TOP N and give the value 10. It will show top 10 customers by sales amount in descending order. I hope this helps.
    Edited by: sapwings on Feb 24, 2011 4:53 PM

  • Sorting a Key Figure by default in a query

    Hi,
    I'm trying to set up a query with a key figure that is sorted in descending order by default everytime.  I tried creating the following condition:
    Key Figure - Sales Volume
    Operator - Top %
    Values - 100
    This sorts the key figure in descending order to a point.  When I add a characteristic to the report (for example, sold to), the sorting is no longer active.  I would like this key figure to remain sorted in descending order regardless of the any manipulation to the report.  But, I'd still like the user to have the ability to change the sorting if they want to sort by another key figure (ascending or descending)
    I'm using the BI 7.0 Query Designer.
    Thanks!!

    Check this:
    Sort Key Figures and Maximum query result
    Organising key figures in BEx Query Designer
    ordering display in a KF
    Hope it helps..

  • Is it possible to sort by two Key Figures?

    Hello experts,
    This is our situation: On a Key figure we have created a condition to display the BOTTOM N by value and by giving it some value which will be never met by within this key figure we’d like to sort a second one to display the TOP N, something like this:
    KF1   KF2
    1      20
    1      10
    1     5
    2      15
    2       5
    3      40
    3      20
    3      10
    Has anyone ever come across a similar situation?
    Many thanks in advance,
    Inma

    Thanks Thomas
    Unfortunately, this solution did not work for me, cover flow still shows multiple instances of the same artwork for various groups of tracks from the same album.
    The thing I don't understand is why sorting by the "sort album artist" field does not group all the tracks from an album together.
    My specific example (I still can't get a screenshot posted):
    I have two Gwen Stefani albums, both ripped from CD (not imported from the itunes store). both albums have a majority of track where Gwen is the only artist and two or three track with featured artists. I have filled the "album artist" and "sort album artist" tags to all read Gwen Stefani, however, if I sort by either of these columns (in cover flow mode), what I get is this:
    all the tracks from one ablum where Gwen Stefani is the artist
    then all the tracks from the other album where Gwen Stefani is the artist
    then (in alphabetical order by featured artist) the remaining tracks from both albums - ie, the albums are mixed up
    for each group of track I see an cover flow art work.
    I should say that I have turned off the compilation tag on all of my albums because this ends up saving the file in a compilation folder, not in the artist folder on my hard drive - but it doesn't make a difference either way to the way I see the files sorted in itunes.
    It's really frustrating!

  • Can not Sorting by Key Figure with Analyzer and Excel 2007

    Hello experts,
    We have recently changed to Office 2007, and the funcionality of Sorting by a Key Figure with BEx Analyzer is desactivated.
    We have applied the patch 10 for BEx  BI 7.10.
    Has anybody had the same problem?
    Thanks in advanced.

    Hi Patricia,
    Have you got two structures in your query?
    Please take a look at the following notes:
    1378796 - Disabled Sorting when there is one struct. in the drilldown
    1332267 - BExAnalyzer: changes in cell properties dialog / sorting
    these should explain why the sort feature is no longer available in certain scenarios.
    many thanks
    Orla.

  • Sorted by Key Figure

    Hi People,
    I´ve got a query and i need to show the records sorted by a key Figure, for exemplo:
    Caracterist     -           Key-Figure
    100                -              1
    100                -              2
    100                -              3
    100                -              4
    200                -               2
    200                -               3
    200                -               4
    200                -               5
    Does anybody knows how to do that ?
    Thanks,
    Norris.
    Edited by: Norris Silva on Jul 26, 2008 5:36 PM
    Edited by: Norris Silva on Jul 26, 2008 5:38 PM

    Try applying a Top N condition on the key figure and use a large value of N. Update back if it works.

  • Sort data by key figure in Query Designer

    Hi Gurus,
    Is it possible to sort a query according to a key figure from Query designer?
    Thanks

    Using condition TOP N is the solution

  • Sort the Key Figure and put a count on it

    Hi Experts,
    I have a  situation where I have to sort the value of the Key Figures in ascending order and put a count on them.
    Kindly elaborate me a little on this.
    Thanks in advance,
    Kannan

    Hi Kannan,
        If you want to do this setting at the Query Designer level, then select the Properties section for the
    desired Key figure say K1.then select the "Calculations " tab.  Under the Local calculations for "Calculate Results as" select "Counter for all detailed values".Save the query.
    Open the query (say) at Bex Analyzer. From  the context menu for the key figure K1, select "Properties"-->then under Sorting tab select the required order.
    The options mentioned above, i.e  "calculations" and "Sort" is available on web too in the context menu for the key figure.
    The above mentioned setting wil be a display setting>You can modify it as per your requirement at Query Designer.
    NOTE:
    If your requirement is such that K1, should always display the counter , then while creation of the K1 itself , you can select the Exception Aggregation of Type "Counter(all values)". Then, the setting will be permanent.(design time)
    Hope the information helps!
    Best Regards,
    Akshata
    Edited by: Akshata Shenoy on Jun 2, 2009 12:25 PM
    Edited by: Akshata Shenoy on Jun 2, 2009 12:27 PM

  • How to sort key figures

    Hi Gurus,
    Thanks in Advance...........
    How to sort key figures & Way to find out customers with 0 sales.
    Thanks,
    Venkat.

    Hi Rakesh,
    Thanks for your info, i assigned point to you.
    any idea on Way to find out customers with 0 sales....
    Thanks,
    Venkat.

  • Key Figures getting added

    Hi All,
    We arein a process of migrating 3.x Transfer rules and update rules to NW2004s. We are following the standard procedure of migrating the objects such that transfer rules are migrated to a transformations and so do update rules.
    In on of the objects while running the loads after migrations the key figures are getting doubled. We were able to debug the standard code and figure out where addition is happening. Strange things is this is a standard SAP code generated in all the migrated objectsbut in this particular case it has generated some extra code which is adding up the key figures. I am pasting code below for your reference and will appreciate if someone can help us to resolve this.
    As mentioned above the below Read statement is standard in all the TRCS transformations which are migrated from update rules. This read statement fails with sy-subrc = 4 because  <_yth_TG_1>. is empty at this stage but during execution it executes the statement INSERT <_ys_TG_1> INTO TABLE <_yth_TG_1> which populates <_yth_TG_1>  and in turn makes the next read statement successful which is extra in this case. There is one more Read statement which is extra in this particular case and is adding up the key figures.
    =====  PUT groups to target
          IF skipseg_all IS INITIAL.
            READ TABLE <_yth_TG_1>
              WITH TABLE KEY
    here it is reading all the different characteristics and key figurs. eliminating this to cut short the lengthof message,
               ASSIGNING <_ys_TG_1>.
            G1_subrc = sy-subrc.
            G1_tabix = sy-tabix.
            IF G1_subrc = 0.
      aggregation SUM
              <_ys_TG_1>-POS_FRE = <_ys_TG_1>-POS_FRE + G1-POS_FRE.
              <_ys_TG_1>-POS_OCC = <_ys_TG_1>-POS_OCC + G1-POS_OCC.
              <_ys_TG_1>-POS_VAC = <_ys_TG_1>-POS_VAC + G1-POS_VAC.
              <_ys_TG_1>-/BIC/ZKMOSALRY = <_ys_TG_1>-/BIC/ZKMOSALRY + G1-/BIC/ZKMOSALRY.
              <_ys_TG_1>-/BIC/ZFILFTEFX = <_ys_TG_1>-/BIC/ZFILFTEFX + G1-/BIC/ZFILFTEFX.
              <_ys_TG_1>-/BIC/ZWRKFTEPX = <_ys_TG_1>-/BIC/ZWRKFTEPX + G1-/BIC/ZWRKFTEPX.
              ls_cross-insegid      = 1.
              ls_cross-inrecord     = l_recno_SC_1.
              ls_cross-outsegid     = 1.
              ls_cross-outrecord    = <_ys_TG_1>-record.
              CALL METHOD i_r_log->add_cross_tab
                EXPORTING
                  I_S_CROSSTAB = ls_cross.
            ELSE.
              ASSIGN rdsTG_1->*          to <_ys_TG_1>.
              CLEAR <_ys_TG_1>.
              MOVE-CORRESPONDING G1 TO <_ys_TG_1>.
              <_ys_TG_1>-requid    = l_requid.
              l_recno_TG_1          = l_recno_TG_1 + 1.
              ls_cross-insegid      = 1.
              ls_cross-inrecord     = l_recno_SC_1.
              ls_cross-outsegid     = 1.
              ls_cross-outrecord    = l_recno_TG_1.
              CALL METHOD i_r_log->add_cross_tab
                EXPORTING
                  I_S_CROSSTAB = ls_cross.
        Record# in target = sy-tabix - if sorting of table won't be changed
              <_ys_TG_1>-record     = l_recno_TG_1.
              INSERT <_ys_TG_1> INTO TABLE <_yth_TG_1>.
              IF sy-subrc <> 0.
                CALL METHOD cl_rsbm_log_step=>raise_step_failed_callstack.
              ENDIF.
            ENDIF.      "Read table
    This read statement is extra in this code and when this executes the sy-subrc becomes zero and then it adds up the key figures.
            READ TABLE <_yth_TG_1>
              WITH TABLE KEY
    **This also contains the characteristics and key figures which are being update as part of the transformations       
               ASSIGNING <_ys_TG_1>.
            G2_subrc = sy-subrc.
            G2_tabix = sy-tabix.
            IF G2_subrc = 0.
      aggregation SUM
              <_ys_TG_1>-POS_OCC = <_ys_TG_1>-POS_OCC + G2-POS_OCC.
              <_ys_TG_1>-POS_VAC = <_ys_TG_1>-POS_VAC + G2-POS_VAC.
              <_ys_TG_1>-POS_COUNT = <_ys_TG_1>-POS_COUNT + G2-POS_COUNT.
      aggregation MAX
              IF G2-POS_CTSPAN > <_ys_TG_1>-POS_CTSPAN.
                <_ys_TG_1>-POS_CTSPAN = G2-POS_CTSPAN.
              ENDIF.
              ls_cross-insegid      = 1.
              ls_cross-inrecord     = l_recno_SC_1.
              ls_cross-outsegid     = 1.
              ls_cross-outrecord    = <_ys_TG_1>-record.
              CALL METHOD i_r_log->add_cross_tab
                EXPORTING
                  I_S_CROSSTAB = ls_cross.
            ELSE.
              ASSIGN rdsTG_1->*          to <_ys_TG_1>.
              CLEAR <_ys_TG_1>.
              <_ys_TG_1>-CURRENCY = G1-CURRENCY.
              MOVE-CORRESPONDING G2 TO <_ys_TG_1>.
              <_ys_TG_1>-requid    = l_requid.
              l_recno_TG_1          = l_recno_TG_1 + 1.
              ls_cross-insegid      = 1.
              ls_cross-inrecord     = l_recno_SC_1.
              ls_cross-outsegid     = 1.
              ls_cross-outrecord    = l_recno_TG_1.
              CALL METHOD i_r_log->add_cross_tab
                EXPORTING
                  I_S_CROSSTAB = ls_cross.
        Record# in target = sy-tabix - if sorting of table won't be changed
              <_ys_TG_1>-record     = l_recno_TG_1.
              INSERT <_ys_TG_1> INTO TABLE <_yth_TG_1>.
              IF sy-subrc <> 0.
                CALL METHOD cl_rsbm_log_step=>raise_step_failed_callstack.
              ENDIF.
            ENDIF.      "Read table
    Thanks for looking into this and will appreciate your response on this.
    Regards
    Raman

    Have you tried the same thing by deleting the extra 'READ' statement?

  • InfoSet in SAP BI 7.10 and Key figure aggregation

    HI SAP Gurus,
    I am new in SAP BI area. I have my first problem.
    I want to create a report for the profit of goods. 
    The cost of goods(cogs) are constant for each material for one month.
    The formula to calculate the profit of goods = sales turn over u2013 cogs of month *sales amount.
    I have defined in BW time dependent infoObejct with attribute cogs.
    I have 2 info Sources.  InfoCube for transactional sales data from R/3 and material cogs master data loaded from csv file each month to infoObject.
    The info Provider for report is InfoSet (transactional Cube and cogs infoObject) .
    My problems are
    1) When I create an InfoSet, SAP BW create automatically new technical name for all characteristics and key figures and the first technical name should be alias fr each InfoCube and InfoObject in the InfoSet.
    2) The new technical name infoSet erased my aggregation references characteristic (=calmonth)
    3) In the report the key figure cogs was aggregated for each customer sales and customers,    that means the value of cogs is not constant, when it is aggregated according to customer sales order.
    Thanks a lot for your support
    Solomon Kassaye
    Munich Germany

    Solomon find some code below for the start routine, change the fields and edit code to suit your exact structure and requirements but the logic is all there.
    4) Create a Start Routine on the transformation from sales DSO to Profit of Goods InfoCube.
    Use a lookup from the the COG DSO to populate the monthly COG field in the COG DSO.
    **Global Declaration
    TYPES: BEGIN OF I_S_COG,
    /BIC/GOODS_NUMBER TYPE /BIC/A<DSO Table name>-/BIC/GOODS_NUMBER,
    /BIC/GOODS_NAME TYPE /BIC/A<DSO Table name>-/BIC/GOODS_NAME,
    /BIC/COG TYPE /BIC/A<DSO Table name>-/BIC/COG,
    /BIC/PERIOD TYPE /BIC/A<DSO Table name>-/BIC/PERIOD,
    END OF I_S_COG.
    DATA: I_T_COG type standard table of I_S_COG,
    wa_COG like line of i_t_COG.
    *Local Declaration
    data: temp  type _ty_t_SC_1.
    *move SOURCE_PACKAGE[] to temp[].
    temp[] = SOURCE_PACKAGE.
    select /BIC/GOODS_NUMBER /BIC/GOODS_NAME /BIC/COG /BIC/PERIOD  from
    /BIC/A<DSO Table name>
    into corresponding fields of table i_t_COG for all entries in
    temp where /BIC/GOODS_NUMBER = temp-/BIC/GOODS_NUMBER.
    sort i_t_COG by /BIC/GOODS_NUMBER.
    loop at SOURCE_PACKAGE assigning <source_fields>.
    move-corresponding <source_fields> to wa.
    loop at i_t_COG into wa_COG where /BIC/GOODS_NUMBER =
    <source_fields>-/BIC/GOODS_NUMBER and /BIC/PERIOD =
    <source_fields>-/BIC/PERIOD.
    modify SOURCE_PACKAGE from wa transporting /bic/COG.
    endloop.
    endloop.
    5) Create an End Routine which calculates Profit using the formula and updates the result set with the value in the Profit column.
    Given your requirement for the profit calculation
    profit of goods = sales turn over u2013 cogs of month * sales amount
    Write a simple end routine yourself
    *Local Declaration
    loop at RESULT_PACKAGE.
    <result_fields>-profit = <result_fields>-sales turn over - <result_fields>-COG * <result_fields>-sales amount.
    modify RESULT_PACKAGE from <result_fields> transporting profit.
    endloop.
    As the above start and end routines are used to enhance your sales DSO, your fields for customer number and the sales order should already be in your DSO for drilldown.
    Let me know how you get on.

Maybe you are looking for