Sorting in a matrix

Hello,
I'm using a matrix report in SSRS and I'm trying to control the Sorting in a column grouping.  I have fields 'AUM', 'BUYS', 'NEW_MONEY', and 'SELLS' in the grouping.  It will only let me sort it A to Z or Z to A.
Can anyone help me with sorting with a expression?  I would like the order to be 'BUYS', 'SELLS', 'NEW_MONEY', then 'AUM'
Any information would be greatly appreciated.
Thanks,
x

Hi Malibu2,
To define your own order in sorting, this is a way:
Create a calculated field in your dataset. Call it "MySortingOrder" for example. Create an expression for it so it will hold a different integer for any of the possible values of the column that holds 'AUM','BUYS',....
You can use the switch statement to achieve this. For example, if the field you are referring to is named "Action", this is what your expression would look like for your calculated field "MySortingOrder":
=Switch(Fields!Action.Value = 'BUYS','1', Fields!Action.Value ='SELLS','2', Fields!Action.Value ='NEW_MONEY','3', Fields!Action.Value ='AUM','4',TRUE,'5')
Now that you have defined a calculated field with your own priority in order, you can sort on this field (A-Z or Z-A) instead.

Similar Messages

  • Sorting in User Matrix

    Hey All,
    If the user clicks on a column header in a user matrix is there a quick way of sorting that data accordingly? I understand that the developer has to do this manually.
    Does anyone have a code example of how to do this?
    I cannot find any in the forums, samples or help files.
    I use this code to populate my matrix:
    oDBDataSource.Query(oConditions);
    this.OMatrix.LoadFromDataSource();
    Thanks.

    Hi Laura,
    You have another message talking about how to sort a matrix:
    Re: Sort data in matrix using DBDataSources
    The only think you have to do is put this code inside the ItemEvent DoubleClick on the first column of your matrix. Then you have to sort your datas depending on the column clicked.
    Regards
    Trinidad.

  • Sort columns in matrix report

    Hi all
    I create matrix report( in version 9i)
    I want sort columns of report
    when i use order by it sort rows but i want sort columns
    my query is like this:
    SELECT
    Code,
    name,
    DECODE(cons_code, '1', 'A',
    '2', 'B',
    '3','C',
    '4', 'D',
    '5', 'E') Activity,
    SUM(amnt) amount
    From Mytable
    Where ....
    group by
    Code,
    DECODE(cons_code, '1', 'A',
    '2', 'B',
    '3','C',
    '4', 'D',
    '5', 'E')
    my group base on code
    my columns base on Activity
    and cells are Amount
    my report result is:
    ........ B E D A C
    name1 1 1 1 1 2
    name2 3 4 8 6 1
    I want this :
    ........ A B C D E
    name1 1 1 1 1 2
    name2 3 4 8 6 1
    ....

    Hello,
    How about this?
    SELECT Code, name,
    DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D','5', 'E') Activity, SUM(amnt) amount
    From Mytable
    WHERE ....
    GROUP BY Code, name, DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D', '5', 'E')
    ORDER BY code, DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D', '5', 'E')

  • Sort Filter Table Matrix

    Hi,
    I like to use the Sort Filter Table function (right click on the Matrix, plus the SAP icon to be activated) in my Add-On, Matrix.
    Could you please provide me the code?
    Thank you,
    Rune

    Hi Szymon Lipnicki,
    I will open a new Forum ticket, because I cannot give you 10 points in this ticket anymore...
    I will post a new ticket and please drop your answer in the new ticket. The Subject is "Filtering User Matrix"
    Thank you very much, this is good news!!!
    Thank you,
    Rune

  • How to sort data in Matrix report

    I've used Report6i and create report in Matrix format.I want the report to display data in sorting by data in cell. Anyone pls help me.
    --it's show this
    applicant_id/score Score
    08002 400
    08003 200
    08004 700
    08006 653
    08008 560
    08010 800
    -- but i want to see this
    applicant_id/score Score
    08010 800
    08004 700
    08006 653
    08008 560
    08002 400
    08003 200
    i tried to set the group's property( break order property ). It doesn't allow me to set break order property of applicant_id's group to none. And tried to write 'order by' in the SQL statement but it doesn't help.

    Hi,
    If Oracle can give you back the right sort order without any custom sorting,
    that means you should be able to get the same results in WebI.
    If the object that you pull from the universe is the wrong type (like numeric but you want it alphanumeric),
    then you can either request you designer to give you an object with the right data type,
    or you can change it by creating a report variable using
    FormatNumber([original object],"0")
    this will format the number to a number without leading zeroes, thousand separators or decimal point.
    Now you can use the object as if it came from the universe.
    So you can also use it on the x-axis of a chart.
    Btw. you can also do a custom sort on the x-axis(as long as it is an object or variable, not a formula)
    alternative, if you define a custom sort in a table block, you can state it should be used througout the document.
    (so also in the charts.
    Hope this helps,
    Marianne

  • How to sort a system matrix

    I want to sort the data in the <Belegnachdruck> Matrix by the DocNum.
    How can I handle it with SDK?

    Hi!
    thanx for translating
    its too simple, here is code:
    SAPbouiCOM.Matrix printMatrix = (SAPbouiCOM.Matrix)SBOApp.Forms.Item("191").Items.Item("3").Specific;
    printMatrix.Columns.Item("1").TitleObject.Click(SAPbouiCOM.BoCellClickType.ct_Double, 0);
    I don't know your project mission, but you can see here the main idea - double clicking by codeline over column header..
    Hope it'll solve your problem!

  • HI can u help me to sort out this Matrix Problem

    i ve used the following codes to create matrix in SAP 2007 A Pl 15.
    Set objItem = frmBPMaster.Items.Add("CCMatrix", it_MATRIX)
            Set oMatrixCC = objItem.Specific
            Set oColumns = oMatrixCC.Columns
            oMatrixCC.Layout = mlt_VerticalStaticTitle
    Set objItem = frmBPMaster.Items.Add("CCMatrix", it_MATRIX)
            objItem.Left = 175
            objItem.Width = 230.59
            objItem.Top = 135
            objItem.Height = 150
            objItem.ToPane = 2
            objItem.FromPane = 2
            Set oMatrixCC = objItem.Specific
            Set oColumns = oMatrixCC.Columns
            oMatrixCC.Layout = mlt_VerticalStaticTitle
            Set oColumn = oColumns.Add("#", it_EDIT)
            oColumn.Width = 2
            oColumn.RightJustified = True
            oColumn.Editable = False
            oColumn.DataBind.SetBound True, "", "20_CC"
            Set oColumn = oColumns.Add("CCName", it_EDIT)
            oColumn.TitleObject.Caption = "Credit Card Name"
            oColumn.Width = 16  
            oColumn.Editable = True
            oColumn.DataBind.SetBound True, "", "21_CC"
            oMatrixCC.Clear
            oMatrixCC.AddRow
            oMatrixCC.SetLineData 1      
            oMatrixCC.Columns("#").Visible = False
            oMatrixCC.AutoResizeColumns
    finally It shows multiple of columns in that matrix but i just want like this
    CCname -
    Type      -
    NO        -

    No, I didnt meant it so. Through SDK you arent able to do it with matrix object. The way which is functional I found is create form in screen painter -> you`ll receive srf file (xml) and in this xml is something as
    <action type="add"><item uid="matrixMZ" type="127" left="10" tab_order="0" width="1180" top="53" height="450" visible="1" enabled="1" from_pane="0" to_pane="0" disp_desc="0" right_just="0" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1"><AutoManagedAttribute/><specific SelectionMode="1" layout="0" titleHeight="16" cellHeight="16"><columns>
    and there is cellHeight="16" ...
    The other way is save form as xml (property of form, example is in sdk help) and load it with height property.

  • Date Sorting is not working as expected

    Hey,
    I am using Report builder 3.0 to create one daily report where I need daily metrics and I am putting it under columns. I want it in day wise order but somehow it shows data in below format. My dates are in M/D/YYYY format. Notice how 1/10 is displayed
    before 1/2.
    Solutions tried -
    1. I tried Putting Date as first thing in the Sorting section on matrix.
    2. Created Expression in Sort  =Day(Fields!Date.Value)
    3. Created custom code to prepond 0 to day and month so dates becomes in MM/DD/YYYY format but it is not working.
    Query -
     SELECT NON EMPTY { [Measures].[Work Item Count] } ON COLUMNS, NON EMPTY { ([Work Item].[System_State].[System_State].ALLMEMBERS * [Date].[Date].[Date].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( STRTOMEMBER(@FromDateDate,
    CONSTRAINED) : STRTOMEMBER(@ToDateDate, CONSTRAINED) ) ON COLUMNS FROM ( SELECT ( STRTOSET(@WorkItemClaimsSandboxTargetVersion, CONSTRAINED) ) ON COLUMNS FROM ( SELECT ( { [Work Item].[System_WorkItemType].&[Defect] } ) ON COLUMNS FROM ( SELECT ( { [Team
    Project].[Team Project Hierarchy].&[{########-####-####-####-############}] } ) ON COLUMNS FROM [Work Item])))) WHERE ( [Team Project].[Team Project Hierarchy].&[{########-####-####-####-############}], [Work Item].[System_WorkItemType].&[Defect],
    IIF( STRTOSET(@WorkItemClaimsSandboxTargetVersion, CONSTRAINED).Count = 1, STRTOSET(@WorkItemClaimsSandboxTargetVersion, CONSTRAINED), [Work Item].[ClaimsSandbox_TargetVersion].currentmember ) ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE,
    FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
    Replaced alphanumeric char with #### above.
    Nothing worked. Please help me out here. I am stuck for a month or so. Would appreciate your prompt response.
    Thanks in advance,
    Shrikant

    Hi Shrikant,
    Per my understanding that you have some problem when sorting on the column group on the matrix, which don't work, right?
    I have tested on my local environment and can't produce the issue, you issue can be caused by the wrong method you have used to setting the sorting, you may set the sorting by select the "Tablix Properties", if so, it will not work.
    Please reference to the details information below about how to do the sorting setting:
    Right click the "Column Group" and select the "Group Properties".
    Select the Sorting on the left pane and do the setting like below:
    This setting works fine on my side.
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu
    If you have any feedback on our support, please click
    here.
    Vicky Liu
    TechNet Community Support

  • Control sort order of UDO Child

    Hey All,
    Can anyone tell me how I can control the display order of a document UDO lines matrix? We have document lines created that have a date in the data and the client would like the data to display with the newest entries on top.
    Anyone know how I can do this?

    I can see one possibility, but I have never tried it on a UDO screen.  Basically I am thinking you might be able to use a variation on a technique I described previously for adding sorting into a DBDatasource based screen
    Re: Sort data in matrix using DBDataSources
    Theoretically this might work for your UDO although you would also need to handle the fact that the UDO itself will be attempting to auto-populate the matrix whereas in my previous posting the matrix population was always under user control. (Either matrix.clear or set bubbleevent = false might handle this additional complexity)
    I think you could probably end up with something like the following
    - Intercept MATRIX_LOAD event
    - ??matrix.Clear??
    - **Populate Array from dbdatasource & Quicksort it**
    - for counter = 0 to (DBDataSource.Size - 1)
    -    Set offset on DBDataSource to **offset from Array**
    -    Matrix.Addrow
    - next
    - ??BubbleEvent = false??
    I have never tried it so it might not work out when it comes to updating, but on the plus side it should be pretty quick to add into an existing screen to test.
    One final thought - For a <b>really</b> quick test to see if it is likely to work before going to the trouble of introducing the array & proper sorting routine, simply loop through the dbdatasource from last record down to first record and see if everything still works with the rows displayed in reverse order.
    eg.
    - Intercept MATRIX_LOAD event
    - ??matrix.Clear??
    - for (DBDataSource.Size - 1) to Counter Step -1
    -    Set offset on DBDataSource to counter
    -    Matrix.Addrow
    - next
    - ??BubbleEvent = false??
    Hope it works out,
    John.

  • Matrix.AddRow "eats" rows

    Hello
    I'm trying to do sorting on matrix object. I'm almost there but there is small problem. Here is the code
                    for (int i = 0; i < dbDataSource.Size; i++)
                        dbDataSource.Offset = sortedList<i>.Idx;
                        matrix.AddRow(1, ++i);
    every time I fire double click event (which contains sorting code) my matrix will show less and less items until it becomes blank.
    If it helps somehow I'm posting code which I use for actual sorting.
                if (pVal.ColUID == "col_dost")
                    matrix.Clear();
                    List<Dostawca> dostawcy = new List<Dostawca>();
                    DBDataSource dbDataSource = form.DataSources.DBDataSources.Item("@CT_PRP1");
                    int count = dostawcy.Count;
                    int k = 0;
                    for (int i = 0; i < dbDataSource.Size; i++)
                        string sValue = dbDataSource.GetValue("U_CardName", i);
                        Dostawca dostawca = new Dostawca();
                        dostawca.Nazwa = sValue;
                        dostawca.Idx = k;
                        dostawcy.Add(dostawca);
                        k++;
                    var sortedList = dostawcy.OrderBy(x => x.Nazwa).ToList();
                    for (int i = 0; i < dbDataSource.Size; i++)
                        dbDataSource.Offset = sortedList<i>.Idx;
                        matrix.AddRow(1, ++i);
    and here is my "Dostawca" class
        public class Dostawca
            private string _nazwa;
            private int _id;
            public Dostawca() { }
            public string Nazwa
                get
                    return _nazwa;
                set
                    _nazwa = value;
            public int Idx
                get
                    return _id;
                set
                    _id = value;
    Thanks
    Kamil

    Ok, never mind. I see the problem.

  • Building an array to a specified format..

    I'm trying to build an array that follows a specified output format. The user inputs columns & rows e.g. C x R...amd the the output should read
    C1 C2 C3 C4.....
    R1 V V V V....
    R2 V V V V ...
    Where each V is not a constant, but a user inputed value. Sorta like a matrix in appearance.
    Any ideas??

    You can use a table control and use a property node to set the number of rows and columns. But that just sets the number of rows and columns which are visible. The user can navigate to additional rows and columns.
    You could create an event structure to keep the user within the specified bounds. You could also remove the scrollbars (right-click on table, goto Visible Items, the deselect Horizontal Scrollbar and Vertical Scrollbar).

  • ORA 00911

    I have written an Excel spreadsheet that uses ODBC to **** data out of an Oracle 8.1.6 database. It works fine on my PC but alas doesn't work on my colleague's machine. Instead I get the above message: invalid character.
    It turns out that we have slightly different versions of the Oracle ODBC driver. The twist is that I have the older version, 8.01.0500, whereas my colleague has 8.01.0600.
    Is this likely to be the source of the problem? Is there a compatibility matrix for ODBC drivers anywhere?
    TIA, APC

    Does the problem persist if you update the driver on your colleague's machine? I believe that 8.1.6.3 is the most recent driver for the 8.1.6 client.
    If this doesn't solve the problem, can you post the failing SQL statement?
    Not sure what sort of compatibility matrix you're looking for...

  • Alternative authoring apps listed

    I mentioned this in a previous thread, but for folks just
    catching up,
    I've posted a list of potentially suitable alternative
    authoring
    applications at the AwareTips website:
    http://www.awaretips.net
    With whatever brief insights I could glean from discussions
    here and/or
    quick site visits. It may help during your research... If I
    have time,
    which is always short, perhaps I can implement a rating
    system or some
    other sort of user-feedback... Will see.
    I'll happily take other suggestions, and would love to do
    some sort of
    product matrix as suggested in another thread, but really
    doubt I'll
    have the time to do that...
    Any other insights, etc, happy to entertain those as well.
    Hope it's
    helpful.
    Erik
    Erik Lord
    http://www.capemedia.net
    Adobe Community Expert - Authorware
    http://www.adobe.com/communities/experts/
    http://www.awaretips.net -
    samples, tips, products, faqs, and links!
    *Search the A'ware newsgroup archives*
    http://groups.google.com/group/macromedia.authorware

    Hi,
    you listed toolbox with 3200$ - But authorware user get it
    for 50% cheaper -
    I 'll change to this product ...
    "Erik **AdobeCommunityExpert**"
    <[email protected]> schrieb im
    Newsbeitrag news:f9f64b$qb6$[email protected]..
    >I mentioned this in a previous thread, but for folks just
    catching up, I've
    >posted a list of potentially suitable alternative
    authoring applications at
    >the AwareTips website:
    >
    http://www.awaretips.net
    >
    > With whatever brief insights I could glean from
    discussions here and/or
    > quick site visits. It may help during your research...
    If I have time,
    > which is always short, perhaps I can implement a rating
    system or some
    > other sort of user-feedback... Will see.
    > I'll happily take other suggestions, and would love to
    do some sort of
    > product matrix as suggested in another thread, but
    really doubt I'll have
    > the time to do that...
    >
    > Any other insights, etc, happy to entertain those as
    well. Hope it's
    > helpful.
    > Erik
    >
    > --
    > Erik Lord
    >
    http://www.capemedia.net
    > Adobe Community Expert - Authorware
    >
    http://www.adobe.com/communities/experts/
    >
    >
    http://www.awaretips.net -
    samples, tips, products, faqs, and links!
    > *Search the A'ware newsgroup archives*
    >
    http://groups.google.com/group/macromedia.authorware
    >

  • Custom Matrix column sort

    Hi Professionals!
    I have a column field as "Age group" in a matrix. I want to sort the order in Ascending. I have given my column field values below in the expression which I have used in the column group properties --> sort but its not working. Can you please
    help me to get the required result.
    =switch(
     Fields!Age_Group.Value = "Less than 18","1",
     Fields!Age_Group.Value = "18-25", "2",
     Fields!Age_Group.Value = "26-34", "3",
     Fields!Age_Group.Value = "35-44","4",
     Fields!Age_Group.Value = "45-54","5",
     Fields!Age_Group.Value = "55-64", "6",
     Fields!Age_Group.Value = "Greater than 65","7")
    Thanks!
    sush

    Susheel for the same you mentioned =switch(
     Fields!Age_Group.Value = "Less than 18","1",
     Fields!Age_Group.Value = "18-25", "2",
     Fields!Age_Group.Value = "26-34", "3",
     Fields!Age_Group.Value = "35-44","4",
     Fields!Age_Group.Value = "45-54","5",
     Fields!Age_Group.Value = "55-64", "6",
     Fields!Age_Group.Value = "Greater than 65","7")
    try going that column and in placeholder properties --> go to number tab --> and select as number. 
    Also try going to text box properties --> interactive sorting window.
    Thanks

  • Z-A Sorting Matrix Data

    Hi,
    I have a Matrix Report in the following way:
    Itemcode Sale
    001 200
    002 300
    003 100
    004 500
    005 300
    I want to sort the matrix report in Decending Order Z-A on Sales Column.
    Please help me, it is very urgent for me.
    I will be Thankful to you.
    Thanks and regards,
    Syed Muzzammil

    Hi Syed,
    I am assuming that you re calculating the "YearTotal" sales in a summary column inside your report's data model. If that is the case, then reports does not know the values of this column before creating the report. It calculates this value in every row. So it will not be able to sort by this column, because for sorting you need to know all the values beforehand.
    What you can do is - in Reports data model, you introduce a Formula Column inside the same Group as Item_Code. In this Formula Column, use PL/SQL to calculate the value of YearTotal sales (just total sales for one product over all months). Then go to the Property Inspector of this column, and set Break Order > Descending. This should do to trick.
    Make sure that you drag this column in group to be at the top (above Item_Code).
    For more information, see Builder help on "Break Order property".
    Navneet.

Maybe you are looking for