TopN sort order modification dinamically

Hi there,
I'm a newbie on obiee so maybe I'm asking something obvious but,...
I have a topN table which could by different values, ie: success Rate and Volume. the colum which contains the topN funcion sorted as ascending. Now if we sort by volume we get the topn(data.volumen,@{topN}{30}) to show the best first, when we select succes rate we do topn(data.volumen*-1,@{topN}{30}), this approach works fine for us.
A new requirement is to change dinamically the sort order, to do it I have created a prompt like this:
SELECT case when 1=0 then dummy.dummy else 'Ascending' end FROM subjectArea UNION ALL
SELECT case when 1=0 then dummy.dymmy" else 'Descending' end FROM subjectArea
and stores the result in a presentation variable, when I try to use the variable on a column trying to select the order with case and 2 topN funtion I get an error, I also have tried to use a fake coumn and always get an error. Do you know if is there any way to transform the Ascending/descending to a -1/1 to do something like topn(data.volumen*@{order},@{topN}{30})
thanks for your help,
Fernando

Hi Fernando,
Is this 11g? If so, you don't need to use a CASE statement in the prompt. Use a "variable prompt" to set the presentation variable and populate this with custom values, 'Ascending' and 'Descending'.
You should then be able to use this presentation variable and a CASE statement within the column that you're sorting on. What is the error that you're getting?
JB

Similar Messages

  • Index Sort Order Modification

    We are generating a part numbers index in CS5, but higher versions are available to me. The part number index will include about 17,000 part numbers. The part numbers include alphas and numbers. We need it to sort numeric and then numeric alpha.
    For example we get this:
    1C-4060
    8-20
    1P-2375
    8-22
    3E-4296
    8-22
    3G-3287
    8-21
    4C-3582
    8-20
    120-9143
    8-8
    120-9144
    8-9
    263-9056
    8-5
    263-9057
    8-5
    And we need this:
    120-9143
    8-8
    120-9144
    8-9
    1C-4060
    8-20
    1P-2375
    8-22
    263-9056
    8-5
    263-9057
    8-5
    3E-4296
    8-22
    3G-3287
    8-21
    4C-3582
    8-20
    We tried the "SortParagraphs.jsx" script but it didn't complete because there were too many part numbers.

    I was hoping for a solution where I didn't have to slip the stories. That it would do them all together. SortParagraphs only works if I have all the part numbers in one text box. Thanks for your help.
    When I select all the numbers and run the script to retain formats I get this error.
    When I select the text box and run the script to retain formats it run but only if all the part numbers are in one text box.

  • N9 Photo Gallery sort order - based on what?

    Hello,
    I am thrilled with my N9, but have one problem: I want to use the phone to keep not only photos made with it. I therefore saved extra photos in the Pictures folder. They appear in the gallery, but in a weird order, not based on either the name, EXIF date, modification date or creation date. Is there a possibility to sort them on either of these? All I want is to control the sort order. After all, it is MY gallery...
    On my previous phone (N8) sorting was based on the last modification date. Also not optimal (EXIF date would have been perfect) but still controllable.
    Solved!
    Go to Solution.

    Well, maybe those pictures were never edited outside the phone, I don't know.
    Anyway, I believe I found the explanation: I exported the photos from Picasa, maxing them to a resolution of 1600xXXX. This way all files were created... today. Nevertheless the EXIF information is correctly saved by Picasa, so Date Image Taken was preserved. Although I modified in all files the creation date to be equal to EXIF Date Image Taken (ACDSee/batch/AdjustTimeStamp) , and then also renamed all pictures based on that, the "new" creation date still remains saved somewhere in the picture files and the Gallery sorts the pictures on it! The pictures were sorted in the reversed order I exported them from Picasa... Bad.
    Anyway, since this is not a request forum, it would be futile to say (again) that Nokia should use the EXIF Date Picture Taken for picture sorting. So I don't say it (!).

  • Toggle Finder sort order with AppleScript under Lion 10.7?

    For years I've been using this AppleScript to toggle the sort order of a Finder window:
    if sort direction of column id size column of list view options of window 1 is normal then
        set sort direction of column id size column of list view options of window 1 to reversed
    else
        set sort direction of column id size column of list view options of window 1 to normal
    end if
    (You can replace size with kind, name, modification date, etc.)
    But ever since Lion, this no longer works!
    The little arrow in the column header DOES change, but the items do not re-sort.
    Any way to get this working?

    Why not just click on the columns?

  • Wrong sort order for rapid sequences of images

    When I have a sequence of shots taken at high speed, i.e. a number of them have the same timestamp, being taken within the same second, I find that LR displays some of them out of order. For instance, I have a sequence of 5 frames all with timestamp 9/4/07 2:17:32pm and the file names show up in this order - 1740, 1742, 1741, 1743, 1744 (these are the file names assigned by the camera)
    The frames show in this order with any of the sort order options selected except, of course, File Name, and in that one instance they display in the correct order.
    Is there a way I can specify in LR that I want to sort in Capture Time order then within that in file name order? This would give me the result I want. The reason I don't want to simply use file name order is that with images from different cameras with differing file naming conventions, or with file names I may have applied, that would not give me correct time sequence as shot. I want to see a whole day's images in correct time sequence regardless of file name.
    If there is not a way to specify this in LR, should I add this to the Feature Request list?

    Capture Time and Import Order do the same thing.
    Additional information - I see the same wrong sequence is presented in the import dialog when I try to import the same photos again (they happen to still be on the card). So, I think it is initially caused by the order that the camera lays down the photos in the file structure on the card, or in the way that Windows reads them off the disk. (I have a Canon EOS 30D, SanDisk CF card, using a card reader rather than plugging the camera to the PC.)
    If I use the import dialog's renaming process (in my test I chose filename - sequence) and apply a sequence number to the images the sequence number ends up wrong. So LR is importing the photos in the wrong order (may not be LR's fault?)
    So, this modifies the definition of the problem and of the feature request. No longer is it simply the sort order displayed in the library; it needs to be addressed at import time as well.
    Here is my attempt to redefine the feature request:
    - when importing images that are taken in rapid sequence (multiple shots within the same second) LR should allow for sorting the images by camera-derived file name to correct out-of-sequence delivery from the card/camera. This sort order, when selected, should re-arrange the preview thumbnails so the photographer can verify the images will be imported in the correct order.

  • Sort order on reports

    I've encountered a number of report views where the sorting is obviously flawed. For example if I run the Modification Date Age Report, choose the Age Criteria of Month and Year, and try and sort on the Date - it sorts that field in a string sort, not numeric sort, so I get 1/2001, 1/2002, 1/2003, etc. instead of 1/2001, 2/2001, 3/2001.
    Any way to cure or change the sort order behavior?

    jffgrnfld,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://forums.novell.com/

  • Change in maintanence view sort order

    I have a requirement where i need to change the sort order of the way the data is displayed in the view.
    Ex if the primary key has A,B,C and D. the data is sorted in the order A,B,C and D but i need to show the sorted data as per B,C and D without changing the key of the table.The client want use a variant. can someone tell where in the screen can i change the code for this.
    Thanx

    I don’t think so , There’ll be any setting in table. What you can do , you can go to table Maint. generator -> Modification and in source code you can sort on the basis of user requirement .
    This is the only possibility I can think of ...
    Hope this’ll help you .
    Thanks

  • Changing items sort order at MI04

    Hi, experts.
    I have a requirement here, which is: I need to change the sort order for MI04´s items: instead of the standard sort order (which considers field ISEG-ZEILI as sorting condition), I´ll have to read another field from MARD and use it as sorting condition.
    I´m already inserting an Enhancement into form RELEVANTE_POSITION, where I read data from MARD, create an auxiliar internal table similar to LISEG + my sorting condition field, and re-sort LISEG according to my aux int. table.
    As I know that I shall have some extra work handling all the problems that those modifications may cause on futher execution of MI04, I would like to know if there is an alternative to this approach.
    So, I ask you: have you ever had to do something like that?
    Thanks,
    Mauricio Dotto
    Edited by: Mauricio Araujo Dotto on Dec 7, 2011 3:30 PM

    There's a more detailed thread covering this at Mac Mail re-sort loses selected eMail
    tl;dr: Working as intended. My workaround is to use the arrow key to move to an adjacent message. This refocuses the window.

  • AkAttachmentCategory sort order

    Hello!
    I tried to change sort order of drop-down menu form ASC to DESC. But with no results. By dafault sort was disabled so I changet it to descendig, but nothing changed.
    <customization xmlns="http://xmlns.oracle.com/jrad" version="9.0.5.4.89_560" xml:lang="en-US" customizes="/oracle/apps/fnd/framework/attachments/webui/FND_ATTACH_UPLOAD_PAGE">
    <modifications>
    <modify element="DocCatRN.searchRN.SearchLastUpdatedBy" sortState="descending"/>
    <modify element="AkAttachmentCategory" adminCustomizable="true" sortState="descending"/>
    <modify element="DocCatRN.searchRN.SearchCategoryId" sortState="yes"/>
    <move element="AkAttachmentCategory" after="AkDescription"/>
    </modifications>
    </customization>
    Where should I look to change it?
    Thanks for any idea!

    If someone has similar problem...
    I extended FndCategoryNameVO and set OrderBy in SQL.
    Probaly not the best way, but it's working.

  • Batch Monitor - Sort Order

    I'm running a series of batch compression jobs of a couple of hundred files each, mainly transcoding, but that's probably irrelevant.
    When I submit a job of (say) 200 files, each called NAME_xxx where xxx is a number between 000 and 200 they appear in compressor in alpha numeric order, as expected. However, when I actually submit the job Batch Monitor seems to display them in a completely random order, even though it's processing them in alpha numeric order.
    Is there any way to rearrange the batch jobs in the Batch Monitor so that it displays them in the order they are going to be processed? It's a real PITA to have to keep scrolling up and down the window looking for where we are in the queue.
    Yes, I tried the 'Sort Order' button but it does not change the order within a single batch.

    when you restart your database, the modification will take effect..
    bye

  • Album sort order PSE11 - is it by design ?

    When experimenting with the sort order of albums in PSE11, I was surprised to see that in some albums, changing the sort order from 'oldest' to 'newest' did not produce any effect.
    The reason of this probably lies in the menu /preferences/general :
    If you have only pictures taken the same day, the above setting will still show 'oldest first' even you choose 'newest first' for album order.
    I believe that the most used order is 'album order' and that the 'newest first' is very rare.
    I can understand the option to browse 'oldest first within each day' when in 'newest first' in thumbnail view.
    However, I wonder if that option makes sense to sort an album ?
    Was it by design ?
    If it were me...
    I would not use that preference for an album,
    and...
    I would add the option to sort by filename and caption.

    Figured it out. I added "Various Artists" in the Album Artist field for every track and it then sorted them all together.

  • How do I get Iphoto to preserve the sort order when I transfer an album?

    Here's my problem. I carefully sorted my album of 230 photos manually. Each photo was then numbered from 1 to 230.   Then I used IPhoto Library Manager to transfer this album someplace else -- to my desktop, to a thumb drive, to Dropbox---   In every case, when I did that, the photos themselves transfered just fine,  but the sort order I had so carefully constructed has fallen apart and cannot by retrieved. Even  when I  close and then reopen an Album I have transferred to my Desktop, it loses its sort order.  This is driving my crazy  because I need to transfer this album so that it preserves the slideshow I have designed for it. A slideshow, of course, demands preserving the order of the slides.
    In short, how can I preserve the sort order of an album when I transfer it out of one library to another?

    If you're transferring to another library, why are you exporting to the Finder (which is what Desktop, thumbdrive and DropBox are). This doesn’t understand manual sorting from iPhoto.
    Here's one (of several) way(s) to do what you want:
    Make an Album of the photos, then drag the pics into your preferred order.
    Then Photos Menu: Batch Change -> Set Title to Text "John's Birthday", for instance, and tick the box to append a number to each Photo. Now your photos are titled 'John's Birthday 001, John's Birthday 002 ... etc'
    Then File -> Export and in the Export dialogue set the Filename to "Use Title"
    Sort on Filename in the FInder and you end up with a folder full of images in the same order as the Album in iPhoto.

  • Any way to Restore Last Manual Sort Order or Prevent from being Overwritten accidentally?

         Help!
         I'm constantly accidentally overwriting painstakingly created manual sort ordering (sometimes hours but more often months of accumulated work) in folders with files numbering up to 1,000, when i, however breifly, switch to another sort ordering (size, date modified etc) to check something, immediately forget that i'm in another sort order, and, unthinkingly (actually i guess i'm thinking of a lot of other things) drag a file to another position, this immediately destroys any past manual sorting i've established, overwriting it with this new inadvertent manual ordering.
         I've tried CommandZ (edit undo) but that only undoes my last rating or labeling, i've rushed to force quit Bridge through the activity montior hoping i will catch it before its overwritten, but obviously i am not as fast as a computer, and i don't think this has ever worked.
    Is there any way or any script someone has written to formally save a manual sort order? Is there anything i've missed to attempt restoring it? Has anyone, repeatedly foiled by this, written something that would give a warning and require confirmation say for instance, if i tried to drag or move a file while in another sort ordering (this seems like something that should have existed the minute the opportunity was given to create manual organization). Would anyone be willing to?
         Seriously, me forgetting almost every time isn't going to change and, more vexingly, it's even happened when i didn't mean to move anything but fumbled momentarily while in another sort order. I think most people might forget because (in the context of computing) we are conditioned to expect a warning if something we have just created is about to be written over or discarded, and since there is no option to formally save a manual ordering we have just created.
         Also, if this was in the real world, moving a single file would not reshuffle everything on your desk. If i had the option to formally save a manual organization i would NOT forget to do this and would use it, as i've wished for one every time spent a while rearranging files. Knowing how easily all the hours (much less months and years of cumulative work) of organizational work can be accidentally lost makes working within Bridge unpleasantly anxious.
          I'm literally willing to do anything including installing some sketchy 3rd-part scripts (though honestly i have no idea what that means or how to do it). I extentively use and rely heavily upon this function so this is a fairly serious Achille's heel. It's like watching your incredibly important meticulously constructed house of cards collapse with a careless but innocent sigh, or like having the equivelent of a not even charming cat dance across your keyboard during a live concert, etc etc....
         Also it is not usually appropriate, given the context, to batch rename everything to preserve a manual ordering w sequence numbers, etc. Often the filenames are considerably (but necessarily, to connote important differences) long already, and when i have to rearrange things in the future would have to do that each time, etc, etc, making for even more unwieldly filenames that didn't have any substantive information at the beginning. I'm looking for a way to make this function (manual sort ordering), well, more functional, secure and stable, the workarounds i've considered cause too many additonal problems.
         Thank you in advance for any help you may be able to offer, and as this is my first attempt to use the forums as i live on a boat with no regular net access, would appreciate any forum etiquette corrections, and advance apologies for any misspellings, dyslexic and spellcheck does not seem to work in this interface. next time will edit in external wordprocessing program beforehand,
              li'l mc szpf
         PS i'm on a 27" mac w CS4 Design Premium, w up to the minute OS (10.6.8) and Adobe software updates installed recently (i do not often move the monster but this week was housesitting w net access, so she has had all recommended shots and vaccinations....)
         PPS I know most of y'all might be running the newest and the latest of everything, but, i'm fairly certain this is still a problem in recent versions as this has happened to me at school where all the macs are running cs5. Though if it's been addressed somehow in cs6 would update entire suite just to fix this one problem in Bridge. I've tried many searches and found nothing relevant or wouldn't bother the considerable expertise and resources of an official forum, was extremely hesitant to ask (feared getting snapped at for unwittingly broaching forum etiquette) but it is truly the bane of my considerable Bridge existence, so was willing to risk the imaginary censure and opprobrium....
    Message was edited by: PECourtejoie

    That is a good question, to do this requires two functions and a restart of Bridge all done automagically
    Copy and paste the script into ExtendScript Toolkit
    This gets installed with Photoshop and can be found:-
    PC: C:\Program Files\Adobe\Adobe Utilities
    MAC: <hard drive>/Applications/Utilities/Adobe Utilities
    Start Bridge
    PC: Edit - Preferences - Startup Scripts
    Mac: Adobe Bridge menu - Preferences - Startup Scripts
    At the bottom click the "Reveal Button" this will open the folder where the script should be saved.
    Close and restart Bridge.
    Accept the new script.
    To use:
    Tools - Backup Manual Sort
    This will backup the hidden manual sort file .BridgeSort to .BridgeSortSave
    Tools - Restore Manual Sort
    This will copy the .BridgeSortSave back to .BridgeSort and will close and restart Bridge so that the manual sort is restored.
    if( BridgeTalk.appName == "bridge" ) { 
    var backUpManSort = new MenuElement( "command","Backup Manual Sort", "at the end of Tools" , "backupms" );
    var RestoreManSort = new MenuElement( "command","Restore Manual Sort", "at the end of Tools" , "restorems" );
    backUpManSort.onSelect = function () {
    var fileSort = new File(app.document.presentationPath +"/.BridgeSort");
    var fileSave = new File(app.document.presentationPath +"/.BridgeSortSave");
    if(fileSave.exists) fileSave.remove();
    fileSort.copy(fileSave);
    fileSave.hidden=true;
    RestoreManSort.onSelect = function () {
    var fileSort = new File(app.document.presentationPath +"/.BridgeSort");
    var fileSave = new File(app.document.presentationPath +"/.BridgeSortSave");
    if(!fileSave.exists){
    alert("No backup file exists");
    return;
    app.document.sorts = [{ type:"string",name:"document-kind", reverse:false }];
    if(fileSort.exists) fileSort.remove();
    fileSave.copy(fileSort);
    fileSort.hidden=true;
    app.document.chooseMenuItem("mondo/command/new");
    app.documents[0].close();
    app.document.sorts = [{ name:"user",type:"date", reverse:false }];
    Hope this works for you.

  • Sort order in list wrong: in CAML and in view

    Hello,
    When I order my list with document sets by ID, the order is wrong. It is wrong in the list and with caml.
    This is my view (I just set the sort on the ID column):
    The first 4 objects are created by the Client Object Model; the last 4 are created by a SharePoint webpart that I developped myself...
    My code for creating document sets in COM is something like this:
    ListItemCreationInformation newItemInfo = new ListItemCreationInformation
    UnderlyingObjectType = FileSystemObjectType.Folder,
    LeafName = _strLeafname // = date in format YYYYMMDDhhmmss
    ListItem newListItem = myList.AddItem(newItemInfo);
    newListItem["ContentTypeId"] = targetDocumentSetContentType.Id.ToString();
    newListItem["Title"] = title;
    newListItem.Update();
    clientContext.Load(myList);
    clientContext.ExecuteQuery();
    The code in the webpart is this:
    SPContentType docsetCt = myLst.ContentTypes[p.GetFromResourcefile("xxxxxxxxxxxxxx")];
    Hashtable properties = new Hashtable
    {"DocumentSetDescription", ""},
    {"Title", txtTitle.Text}
    SPFolder parentFolder = myLst.RootFolder;
    int newId = GetLastId(myLst) + 1;
    DocumentSet ds = DocumentSet.Create(parentFolder, newId.ToString(CultureInfo.InvariantCulture), docsetCt.Id, properties, true);
    ds.Item["Title"] = title
    ds.Item.Update();
    why is the sort order wrong?
    if i do this query in the U2U Caml builder, the order is also wrong
    <OrderBy><FieldRef Name='ID' Ascending='FALSE' /></OrderBy>
    if i order by "created", the order is also wrong....
    i don't get it....

    Document Sets are great tools for grouping multiple documents together. However, if every set has exactly one document, it would be better to just upload the file and not place it within a Document Set:
    Uploading documents using object model - http://msdn.microsoft.com/en-us/library/office/ms454491(v=office.14).aspx
    Uploading documents using web services -
    http://cecildt.blogspot.com/2010/10/upload-documents-to-sharepoint-2010.html
    If you have requirements to use Document Sets, keep in mind that this adds a layer of complexity beyond a simple Document Library. Behind the scenes, each Document Set is treated as a separate folder, and although can you query items within it, there might
    be extra steps for getting the sort order to ignore the folder structure. Can you try setting the Scope to be "Recursive" and also specify that you are looking only for files and not folders:
    <Eq><FieldRef Name='FSObjType'/><Value Type='Lookup'>1</Value></Eq></Where>
    Dimitri Ayrapetov (MCSE: SharePoint)

  • List of found events changes sort order when pasted from clipboard

    when I find a set of events in iCal, the list appears in the window at the bottom of the page in the correct sort order when sorted by date, title or type. When I then copy that list to the clipboard and paste it into another program (Pages, MacJournal, TextEdit) the sort order changes.
    I work mostly in English, but my macbookpro keyboard is German, so I assume the problem is with the language settings. I've tried changing the system preferences for language and sort order, and that changes the sort order, but it doesn't get it right.
    Anyone have any ideas?
    Thanks

    when I find a set of events in iCal, the list appears in the window at the bottom of the page in the correct sort order when sorted by date, title or type. When I then copy that list to the clipboard and paste it into another program (Pages, MacJournal, TextEdit) the sort order changes.
    I work mostly in English, but my macbookpro keyboard is German, so I assume the problem is with the language settings. I've tried changing the system preferences for language and sort order, and that changes the sort order, but it doesn't get it right.
    Anyone have any ideas?
    Thanks

Maybe you are looking for

  • Error while updating device software

    I was trying to update device software using latest ovi suite and suddenly my device stop working. nowitsnot able to switch on...and while i tried to installing software..i also got 12017 error.. please help me ..my cell is dead now

  • PLS HELP!Nokia 7370 HS-31 Headset problem! SOS!!!S...

    Hi! Today I'm buyed a new and original HS-31 phone headset, but when I connect this headset to my Nokia 7370 phone, the headset is very in undertones to run. I'm barely hear anything (radio or a call). What's the problem???? Please HELP me!!! It's ve

  • Enterprise Wireless using WPA, TKIP, PEAP

    I received my wireless protocols from my work. However, it doesn't look like iPhone will be able to connect. Here are the instructions for connecting a Windows computer to the network. Is there a way to configure the iPhone to do the same? 1. Manuall

  • ITunes FileID race

    I am getting an error message in iTunes that says the following: "The iTunes Library File cannot be saved. An unknown error occurred (-48)." I did some searching and all I found about this error was stuff that seemed to related to virus scanner confl

  • Program name for smartform

    i hav made a smartfomr and a driver program for it but now i forgot the program name for it can some body plz help me to find it out i hav cheked table tnapr but did not get anything as it is not showing my z table plz help