Is it possible to order a group by a different field

I have a report that groups everything perfectly by Type.  The issue I am having is trying to order the values returned in each grouping by a different field in the returned data, it is a number.
Is it possible to sort a group based on a field in the returned data, without having to create another group?

Never mind, just made the the second field a sub group

Similar Messages

  • DAX - Grouping by 2 different fields in 1

    Hi,
    Imagine a table that has persons. Persons have a set of attributes like Father and Mother profession. In each of the fields, the contents are on the same context, you can have a person that has a father or mother that is a doctor, engineer or teacher.
    Imagine this set of data now:
    Name: Michael - Father Profession: Doctor -
    Mother Profession: Teacher
    Name: John - Father Profession: engineer - Mother Profession: Teacher
    Name: Sarah - Father Profession: Doctor - Mother Profession: engineer 
    Name: Connor - Father Profession: engineer - Mother Profession: Teacher
    What I want is to group the 2 profession fields to count the number of people that has a father /mother of that profession, so In the end the result has to be like this (3 fields) -
    using DAX expressions
    Doctor: 2 on Father  0 on Mother
    Engineer: 2 on father 1 on mother
    Teacher: 0 on father 3 on mother
    Thank you

    Hi Pedro,
    According to your description, you want to group number of fathers and mothers on Profession based on your source data. Right?
    In Analysis Services Tabular, there's no function to pivot the result set in DAX. For your requirement, the most effective workaround is calculate the result on T-SQL query level. Then return retrieve it into Tabular. Please refer to the query below:
    create table #temp1(
    name nvarchar(50),
    parent nvarchar(50),
    profession nvarchar(50))
    insert into #temp1 values
    ('Mike','Father','Doctor'),
    ('Mike','Mother','Teacher'),
    ('John','Father','Engineer'),
    ('John','Mother','Teacher'),
    ('Sara','Father','Doctor'),
    ('Sara','Mother','Engineer'),
    ('Connor','Father','Engineer'),
    ('Connor','Mother','Teacher')
    WITH Cte AS(
    select profession,parent,count(1) count from #temp1 group by profession,parent
    SELECT profession,isnull([father],0) father,isnull([mother],0) mother FROM Cte
    pivot
    sum(count) for parent in([father],[mother])
    ) as pvt
    Best Regards,
    Simon Hou
    TechNet Community Support

  • Order Graph Based on a different field

    I'm creating a bar graph to track our design work for a specific season.   I want the bar grapsh to have a sort order based on the taskID but display the Ttask Description on the chart.   Here is an example of the data.  RIght now the chart is based on the Task Description so the tasks are sorted in alphabetical order.   The result is the graph shows the tasks in the wrong sequence.
    I appreciate your help solving this issue.
    TaskID  Task Description
    10 Turn over item from Design
    20 Quote product item cost
    30 Order Design Sample
    40 Season Management Review

    Sorry for the delay in responding to your reply.  Let me give a little more background.  We design gift items for specific seasons.  A season may have 50 - 100 designs.  All designs have 7 tasks that management wants to track.  They want a bar chart that shows the description of the tasks on the x axis.   The bar chart shows how many jobs per task are not started, in progress or completed.  This is working as designed.  The only problem is the descriptions of the tasks are in alphabetical order, not the actual sequence in which they occur.    To get the proper sequence there is another field called TaskID.  When I use this field, then the number of the task is dsplayed on the graph, not the description.  
    So, the question is how can I show the bars of the graph based on the TaskID but display the desctription?  THanks for your help.

  • Is it possible to order extra large and large copies of an iPhoto album from the same book?, Is it possible to order extra large and large copies of an iPhoto album from the same book?

        Hi
    Does anyone know if it is possible to order an iPhoto book in different sizes? We have just created an iPhoto book and we would like to order it in large and extra large but when you click Buy Book it loads the original option selected.
    I know you could say that should have thought about this beforehand but new to iPhoto itself.....really do not want to have to recreate as extra large as this has taken us some time to sort out already and thought would ask before coming to a conclusion.
    Please could you let me know?
    Many thanks
    Kate

    Sure - select the book in the source pane on the left and duplicate it (just in case of problems) - depress the command key and type "D" - then go to themes and select the new size, verify that it worked and preview it -
    Before ordering your book preview it using this method -http://support.apple.com/kb/HT1040 - and save the resulting PDF for reference - the delivered book will match it.
    then order it
    LN

  • Is it possible to rank with group condition?

    Is it possible to rank with group condition? for example I have following dataset.
    RANK() OVER (partition BY PC.POLICY_NUMBER, PC.TRANSACTION_TYPE, COV_CHG_EFF_DATE order by PC.POLICY_NUMBER, COV_CHG_EFF_DATE, PC.TIMESTAMP_ENTERED) AS RNK,
    POLICY_NUMBER    TRANSACTION_TYPE  COV_CHG_EFF_DATE  TIMESTAMP_ENTERED                        Rank
    10531075PQ                           01           01/FEB/2009              15/SEP/2009 01:16:09.356663 AM       1
    10531075PQ                           01           01/FEB/2009              15/SEP/2009 01:16:09.387784 AM       2
    10531075PQ                           02           15/OCT/2009             16/OCT/2009 04:40:24.564928 PM       1
    10531075PQ                           02           15/OCT/2009             16/OCT/2009 04:40:24.678118 PM       2
    10531075PQ                           10           15/OCT/2009             16/OCT/2009 04:45:20.290117 PM       1
    10531075PQ                           10           15/OCT/2009             16/OCT/2009 04:40:29.088737 PM       2
    10531075PQ                           09           15/OCT/2009             16/OCT/2009 04:40:29.088737 PM       1 (expected 3)
    10531075PQ                           06           17/OCT/2009             17/OCT/2009 04:45:20.290117 PM       1
    10531075PQ                           07           17/OCT/2009             17/OCT/2009 04:40:29.088737 PM       1 (expected 2) I want to group rank based by transaction IDs. For ex, '09' and '10' as one set and '06' an '07' as another set. Instead of rank from start, I want rank continue for any occurance of '09' or '10'. In the above example, for the following row, I am expecting rank 3 as there are 2 transaction '10' already exist for same COV_CHG_EFF_DATE.
    10531075PQ 09 15/OCT/2009 16/OCT/2009 04:40:29.088737 PM 1 (expected 3)
    I wonder if it possible with Rank or another other analytical function. I am not looking for exact working code, but will appreciate if someone give me idea/tips. Sample table, and test data if anyone want experiment
    drop table PC_COVKEY_PD;
    create table PC_COVKEY_PD (
    POLICY_NUMBER varchar(30),
    TERM_IDENT varchar(3),
    COVERAGE_NUMBER varchar(3),
    TRANSACTION_TYPE varchar(3),
    COV_CHG_EFF_DATE date,
    TIMESTAMP_ENTERED timestamp
    delete from PC_COVKEY_PD;
    commit;
    insert into PC_COVKEY_PD values ('10531075PQ', '021', '002', '01', to_date('01/FEB/2009','DD/MM/YYYY'), cast('15/SEP/2009 01:16:09.356663 AM' as timestamp));
    insert into PC_COVKEY_PD values ('10531075PQ', '021', '001', '01', to_date('01/FEB/2009','DD/MM/YYYY'), cast('15/SEP/2009 01:16:09.387784 AM' as timestamp));
    insert into PC_COVKEY_PD values ('10531075PQ', '021', '004', '02', to_date('15/OCT/2009','DD/MM/YYYY'), cast('16/OCT/2009 04:40:24.164928 PM' as timestamp));
    insert into PC_COVKEY_PD values ('10531075PQ', '021', '004', '02', to_date('15/OCT/2009','DD/MM/YYYY'), cast('16/OCT/2009 04:40:24.264928 PM' as timestamp));
    insert into PC_COVKEY_PD values ( '10531075PQ', '021', '005', '10', to_date('15/OCT/2009','DD/MM/YYYY'), cast('16/OCT/2009 04:40:24.364928 PM' as timestamp));
    insert into PC_COVKEY_PD values ('10531075PQ', '021', '002', '10', to_date('15/OCT/2009','DD/MM/YYYY'), cast('16/OCT/2009 04:40:24.464928 PM' as timestamp));
    insert into PC_COVKEY_PD values ( '10531075PQ', '021', '004', '09', to_date('15/OCT/2009','DD/MM/YYYY'), cast('16/OCT/2009 04:40:24.564928 PM' as timestamp));
    insert into PC_COVKEY_PD values ('10531075PQ', '021', '004', '06', to_date('22/NOV/2011','DD/MM/YYYY'), cast('17/OCT/2009 04:40:24.564928 PM' as timestamp));
    insert into PC_COVKEY_PD values ('10531075PQ', '021', '004', '07', to_date('22/NOV/2011','DD/MM/YYYY'), cast('17/OCT/2009 04:40:24.664928 PM' as timestamp));
    commit;
    SELECT POLICY_NUMBER,
           TERM_IDENT,
           COVERAGE_NUMBER,
           TRANSACTION_TYPE,
           COV_CHG_EFF_DATE,
           TIMESTAMP_ENTERED,
            RANK() OVER (partition BY PC.POLICY_NUMBER, PC.TERM_IDENT, PC.TRANSACTION_TYPE, PC.COV_CHG_EFF_DATE
                    order by PC.POLICY_NUMBER, PC.TERM_IDENT, PC.COV_CHG_EFF_DATE, PC.TIMESTAMP_ENTERED) AS RNK
    FROM PC_COVKEY_PD PC
    ORDER BY PC.POLICY_NUMBER, PC.TERM_IDENT, PC.COV_CHG_EFF_DATE, PC.TIMESTAMP_ENTERED ;Edited by: 966820 on 30-Oct-2012 19:26

    Hi,
    966820 wrote:
    I want to group rank based by transaction IDs. For ex, '09' and '10' as one set and '06' an '07' as another set. So, whenever you see '09', you want to treat it as '10', and whenever you see '06', you want to act as if it were '07'.
    You can use CASE to map '09' to '10', and '06' to '07'. like this:
    ,       RANK () OVER ( PARTITION BY  policy_number
                                  ,             term_ident
                    ,            CASE  transaction_type
                                    WHEN  '06'  THEN  '07'
                                    WHEN  '09'  THEN  '10'
                                            ELSE  transaction_type
                               END
                    ,            cov_chg_eff_date
                    ORDER BY      timestamp_entered
                     )     AS rnkWhen you "PARTITION BY x", there's no point in saying "ORDER BY x" in the same analytic clause.
    Thanks for posting the CREATE TABLE and INSERT statements.
    Thanks, too, for posting your query, though, as mentioned already, it's unreadable. When posting any formatted text (and code should always be formatted), type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.
    See the forum FAQ {message:id=9360002}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Is it/shouldn't it be possible to order postcards with full image on both sides?

    Is it/shouldn't it be possible to order postcards with full image on both sides?

    Yes, you can create such a card.  This example is the folded Holiday Colors theme.  Just choose the layout for the inside that includes a full page photo on top and text on the bottom.
    OT

  • ORDER BY/GROUP BY in XSL/T

    SCENARIO 1:
    Hello all!
         I have got an XML file which contains a list of products. I transform this file into an HTML page using an XSL stylesheet. The XML file looks like the following:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <products>
         <product id="40117" date="20030228">
              <issuer code="A-08244998">MECALUX, Inc.</issuer>
              <description>This is product 4117 description</description>
         </product>
         <product id="31007" date="20030228">
              <issuer code="A-19728222">REDBERRY TECH, Inc.</issuer>
              <description>This is product 31007 description</description>
         </product>
         <product id="4844" date="20030227">
              <issuer code="A-94847402">JYL SOFT, SA.</issuer>
              <description>This is product 4844 description</description>
         </product>
         <product id="3711" date="20030227">
              <issuer code="A-74185296">SOFTEC, Inc.</issuer>
              <description>This is product 3711 description</description>
         </product>
         <product id="566" date="20030226">
              <issuer code="A-08244998">MECALUX, Inc.</issuer>
              <description>This is product 566 description</description>
         </product>
         <product id="41621" date="20030226">
              <issuer code="A-74185296">SOFTEC, Inc.</issuer>
              <description>This is product 41621 description</description>
         </product>
    </products>
    I would like to order the file by date and then by product id. So the list I'll generate in HTML would have a heading with the date of the products (from most recent to oldest) and then another subheading product-id / Issuer name ordered by ascending product id, like this:
    ---------------- DATE: 2/28/2003 ------------------------
    Product-ID     Issuer Name
    31007 REDBERRY TECH, Inc.
    40117 MECALUX, Inc.
    ---------------- DATE: 2/27/2003 ------------------------
    Product-ID     Issuer Name
    3711 SOFTEC, Inc.
    4844 JYL SOFT, SA.
    ---------------- DATE: 2/26/2003 ------------------------
    Product-ID     Issuer Name
    566 MECALUX, Inc.
    41621 SOFTEC, Inc.
    To sort the data from within the XSL stylesheet I'd use:
         <xsl:apply-templates select="product">
              <xsl:sort select="@date" data-type="number" order="descending"/>
              <xsl:sort select="@id" data-type="number" order="ascending"/>
         </xsl:apply-templates>
    I'd like to write only once the date heading for each product with the same date. Template "product" would output the information of the current product, formatting it as an HTML table row.
    MY QUESTION: How can my stylesheet "remember" the date of the last product processed to know whether I should output a new heading with the date of the current product? The idea is to code the "IF" statement and the use of variable "last_date" but I don't know how in XSL/T.
    Any help would be highly appreciated.
    Thanks in advance.
         last_date = ""
         WHILE there are products DO
              product = GET_NEXT_PRODUCT
              IF product.date != last_date THEN
                   WRITE_DATE_HEADING( product.date )
                   last_date = product.date
              END-IF
              WRITE_PRODUCT_INFO( product )
         END-WHILE
    SCENARIO 2:
    Let's supose the following XML file. I'd like to generate an HTML page
    with a list of products ORDERED BY product description and GROUPED BY
    category name.
    The listing would look like the following:
         Category 1
              product-description [product-id], isuer name
         Category 2
              product-description [product-id], isuer name
         Category 3
              No products at stock
         Category 4
              product-description [product-id], isuer name
    MY QUESTION: The XML file may not be ordered by any criteria. How could I order and group the data in this case? Would it be simpler/easier if the XML file were ordered (or semi-ordered) in any way?
    The XML file would look like the following (note that there are no
    products of category 3):
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <stock>
         <categories>
              <category id="C1">Category 1</category>
              <category id="C2">Category 2</category>
              <category id="C3">Category 3</category>
              <category id="C4">Category 4</category>
         </categories>
         <products>
              <product id="40117" date="20030228" category="C4">
                   <issuer code="A-08244998">MECALUX, Inc.</issuer>
                   <description>This is product 4117 description</description>
              </product>
              <product id="31007" date="20030228" category="C4">
                   <issuer code="A-19728222">REDBERRY TECH, Inc.</issuer>
                   <description>This is product 31007 description</description>
              </product>
              <product id="4844" date="20030227" category="C2">
                   <issuer code="A-94847402">JYL SOFT, SA.</issuer>
                   <description>This is product 4844 description</description>
              </product>
              <product id="3711" date="20030227" category="C4">
                   <issuer code="A-74185296">SOFTEC, Inc.</issuer>
                   <description>This is product 3711 description</description>
              </product>
              <product id="566" date="20030226" category="C2">
                   <issuer code="A-08244998">MECALUX, Inc.</issuer>
                   <description>This is product 566 description</description>
              </product>
              <product id="41621" date="20030226" category="C1">
                   <issuer code="A-74185296">SOFTEC, Inc.</issuer>
                   <description>This is product 41621 description</description>
              </product>
         </products>
    </stock>

    Scenario 1
    How can my stylesheet "remember" the date of the
    last product processedYou can't do it this way, a stylesheet doesn't support the concept of global mutable variables.
    But you can apply a test on this axis "preceding-sibling::product" to see if exists a previous product with the same date.

  • Is it possible to order in HK a Macbook Pro 15" with german keyboard layout?

    I'm from Austria and I will move to Hong Kong for 5 years. Is it possible to order a Macbook Pro 15" with german keyboard layout

    hiya,
    i also bought a macbook pro from hong kong recently.
    during checkout there was no option selecting a specific keyboard
    layout. it come with standard international keyboard.
    maybe you can call up apple hong kong online store and ask?

  • Is it possible to run a group solve from the batch manager?

    I'd like to know if it is possible to run a group solve defined in OFA 11i that contains solve and copy data from the batch manager.
    Thank you
    Luigi Polverini
    Synesis s.r.l.
    null

    Problem: I have a Perl script in my AIR App's install directory that needs executable permissions on a Mac.
    Solution: Chmod the file in my AIR App.
    My code looks something like the following:
    if (Capabilities.os.indexOf("Mac OS") > -1) {       
                        var dlFile:File = File.userDirectory;
                        var _chmod:File = new File("/bin/bash");
                        dlFile = new File(file);
                        var nativeProcess:NativeProcess = new NativeProcess();
                        var chmodStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
                        chmodStartupInfo.executable = _chmod;           
                        var args:Vector.<String> = new Vector.<String>();
                        args.push("-c"); 
                         // Trace so I can make sure the command and path are correct in the debugger              
                        trace ("\"chmod ugo+x '"+dlFile.nativePath+"'\"");
                        args.push("chmod ugo+x '"+dlFile.nativePath+"'");
                        chmodStartupInfo.arguments = args;
                        nativeProcess.addEventListener(NativeProcessExitEvent.EXIT, onExitError );
                        chmodStartupInfo.executable = new File(file);                       
                        var process:NativeProcess = new NativeProcess();
                        process.start(chmodStartupInfo);  
    I really hope this helps someone else.

  • Is it possible to prevent a group of users be added into other groups?

    We have a admin group named "app admin" which has full privileges to a target OU "ou=apps,ou=services,dc=xxx,dc=com".
    And we are looking for solution to prevent members in the admin group putting their own account or group members into the target OU.
    Tried the aci with "deny self write", but it only prevents admin user put their own DN into the target OU.
    And they still can add their group members into the target OU.
    Just wondering is it possible to prevent a group of users be added into the target OU while they still can add/delete/modify normal users into the target OU?
    The version of our Directory Server is 6.3.1.
    Thanks

    goog,
    For each data member, you will need a unique URL. There is not a way to bundle them into one URL.
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • Is it possible to access a group of (sequentia​l) registers with a single URL?

    I'm testing out datasockets to an A-B RSLinx OPC server. At the moment, it appears as though each register in the PLC has to be accessed with an individual URL. Is it possible to access a group of (sequential) registers with a single URL? I suspect i may have to cluster a bunch of individuals together

    goog,
    For each data member, you will need a unique URL. There is not a way to bundle them into one URL.
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • Is it possible to order a MBP with Swedish keybord to a retailer in the US?

    Hi
    Is it possible to order a BMP with Swedish keybord to a retailer in the US?
    According to the webpage it is possible but I doubt that.
    Cheers

    It is possible if you order from Apple's website. http://http://store.apple.com/us/buy-mac/macbook-pro Select the mac you want. Then you can customize it with different storage options. Under the keyboard selection pic Swedish keyboard. Then just have it mailed to your address.
    Hope this helped!

  • Is it possible to order a macbook air with a swiss keyboard in the US shop?

    is it possible to order a macbook air with a french swiss keyboard in the US shop?

    Welcome to Apple Support Communities
    It's very difficult to find a Mac with a non-US keyboard at a US store, but Apple sells Macs with different keyboard layouts at the Apple Online Store if you want to > http://store.apple.com/us/mac/family/macbook-air
    You can buy a MacBook Air with a French keyboard at the Apple Online Store, but if you want one with a Swiss keyboard, I recommend you to call the Apple Online Store to see if it's possible in the United States (1-800-MY-APPLE)

  • I have 160gb of music on my Classic, 6th Gen (I think) I've just bought it. Is it possible for it to play my songs in a random order, one or two from different albums?

    I have 160gb of music on my Classic, 6th Gen (I think) I've just bought it. Is it possible for it to play my songs in a random order, one or two from different albums?

    To add to what Stonerock has mentioned, you can either create Playlists in your iTunes Library, containing exactly what you want, and then Sync them to your iPod, or you can use the iPod Classic's On-The-Go feature.
    Reading between the lines, I'm going to assume for now that you want to be able to create your preferred listening list while "out and about" - so not near your iTunes library. (You have posted in iPod Classic, after all.) You can do this with the On-The-Go Playlist.
    Look in the Playlists menu on the iPod. It probably contains the Recently Added, Recently Played and other pre-made Playlists that you see in your iTunes Library. At the bottom of the Playlists list, is the On-The-Go showing 0 Songs. Scroll down to it and press the Select (centre) button. The screen will give you instruction on adding songs to the On-The-Go Playlist.
    Basically, if you press-and-hold the Select (centre) button, while highlighting a song, the song title will blink as it is added to the On-The-Go Playlist. Try it, then go back to Playlists/On-The-Go and notice that it will now say 1 Song. (Note, you cannot add a "now playing" song to the On-The-Go Playlist.) Repeat this for every song you want to have in the list. You can also look in the Albums menu, highlight the album title and press-and-hold that to add the complete album to your On-The-Go Playlists with one press. So if you add the two albums to your On-The-Go Playlist, you can then listen to just those two albums.
    To shuffle the songs, turn on Shuffle on your iPod. Either, go into Settings/Shuffle and press the Select button to toggle between Off/Songs/Albums, or on the Now Playing screen, press the Select button three times to reach the Shuffle option, where you use the scroll wheel to move between Off/Songs/Albums, press the Select button to activate it.
    Having added songs to the On-The-Go Playlist, go into it and notice the list of songs and options to Save Playlist (New Playlist 1) or Clear Playlist. If you use Sync to manage your iPod (and that really is the best way by the way), the next Sync will transfer any unsaved On-The-Go and any New Playlist Xs that you have, back to your iTunes Library. You can even remove any song from the current On-The-Go Playlist by highlighting it (in the On-The-Go, obviously) and press-and-holding the Select button.
    If you need assistance in creating a Playlist in your iTunes Library, please ask.

  • Is it possible to lock account Groups of customers

    Hi,
    ist it possible to lock account Groups of customers? I don't want to delete some groups, because
    there some customers with this groups i want to lock, but i will avoid that there are new customers with
    this groups.
    Regards, Dieter

    Hi,
    Yes Basis Consultant will ristrict the authorization of creating certain Customer Groups as satish said.
    So Provide the List of Customer grps to Basis Consultant and ask him to ristrict to all the users.
    Regards,
    Padma

Maybe you are looking for