Some build-in panels are grouped with my plugin Panel in InDesign CC

My settings for panelist look like this:

resources LocaleIndex (kSDKDefPanelResourceID)

{kViewRsrcType,

{kWildFS, k_Wild, kSDKDefPanelResourceID + index_enUS}

};

/ * Definition of panelist.

*/

resources involved (kSDKDefPanelResourceID)

{

{

1 group in the list

kSDKDefPanelResourceID, / / resource ID for this Panel (use SDK by default ID rsrc)

kMyPluginID, / / ID of the plugin which holds this Panel

kIsResizable,

kMTPanelWidgetActionID, / / Action ID to show/hide Panel

"MyPlugin:Test", / / appears in the list window.

"", / / Substitute the form menu path ' hand: Foo "If you want your palette in the second menu item to place

0.0, / / menu replacing the position of the alternative Menu to determine the order of the menu

kMyImageRsrcID, kMyPluginID, / / Rsrc ID, ID Plugin for a PNG icon resource to use for this palette (when it is not active)

c_Panel

}

};

resources MTPanelWidget (kSDKDefPanelResourceID + index_enUS)

{

__FILE__, __LINE__, / / macro location

kMTPanelWidgetID, / / WidgetID

kPMRsrcID_None, / / RsrcID

kBindAll, / / Binding (0 = none)

0, 0, 320, 386, / / framework: left, top, right, bottom.

kTrue, kTrue, / / Visible, Enabled

kTrue, / / clear the background

kInterfacePaletteFill, / / Color Erase

kMTPanelTitleKey, / / name of Panel

{

}

"MyPlugin" / / name of contextual menu (internal)

};

The problem is that when I click on the window-> MyPlugin-> Test liquid integrated panels layout of the article and references are also open and grouped with my Panel. I don't understand what I'm doing wrong. The situation is the same with all the examples in the sdk that have signs. Help, please. 10 x in advance.

My previous post was that this panelMgr-> GetPanelFromWidgetID (kMyPanelWidgetID) does not find the Panel when it is called in the initializer.

I'm now deep - search the trees from the GetRootPaletteNode paletteRef, using PaletteRefUtils methods. For kTabPanelContainerType, I used panelMgr-> GetPanelFromPaletteContainer() to check the ID of widget, fortunately callers already works. For other types, I just go down the children.

Three steps more to move the paletteRef found in a new floating window:

columnRef = PaletteRefUtils::NewFloatingTabGroupContainerPalette(); kTabPaneType

groupRef = PaletteRefUtils::NewTabGroupPalette (column); kTabGroupType

PaletteRefUtils::ReparentPalette(myPanelRef,groupRef,PaletteRef());

If you have several panels, Iterate step 2 + 3 to create groups (lines) per Panel, or just step 3 if they all end up stacked.

Edit: I can find why GetPanelFromWidgetID did not work: apparently initializer priority is considered by plugin, so one of my signs in a plugin different just was not yet registered. Forget all that deep-search tips.

Tags: InDesign

Similar Questions

  • What are compatible with other phones?

    When I submit themes there are several other phones in the same area of the phone that I submit.

    For example: when I submit a theme for Bold 97xx there are four other models of phone (9000, 9050, 9900, 9930) which are an option that I can choose from as well.  If I have marked other phone models, my theme would be compatible with these models?  I ask because they are grouped with the model I selects as well.

    Basically I wonder if all the phone models that are grouped are compatible with each other?

    Phones are grouped in the series (i.e. Bold, Curve series etc.). They are really, for example screen resolution:

    • Half display VGA 480 x 320 pixel color (BlackBerry 9000 "BOLD")
    • Screen color high-resolution 480 x 360 pixels (BlackBerry Bold 9650, 9700, 9780)

    Support for operating system version would be different.

    It seems therefore that the grouping is more related to brand as the specifications of the phone.

  • Why the books are grouped and preinstalled with the operating system?

    It's complaints

    My Portege has Windwosw Vista. I didn't want to buy Vista, but they were only selling with him and no other choice was possible to purchase.

    First of all, my laptop had problems to install Windows updates. I could not connect my institution's Internet System. I had to reinstall the system again.
    It's a waste of time!

    After re-installation of the button for the sound on the outside Panel does not work correctly.

    Also, when I try to stop the laptop sometimes it restarts itself - he doesn't stop!

    Secondly, I had a problem with the laptop, when an opportunity to visit a well-known site, it serves to block itself.
    Once, when he is blocked, I had to restart and its screen remained black. They took for repair. It was delivered later - repaired, but with a defect on the screen!
    What a... workers!

    When I bought this laptop he had an offer with the update of Vista with Windows 7 after their release.
    Wonderful. But just note, Toshiba has the highest price of the offer, compared to its competitors - 30 (or £) against 15 for others, which of course I'm not going to pay.

    I already paid for Vista, which is incredible, and I knew, but I had not choice not to buy!

    All right, so there is still competition in the market, several possibilities are present - install Windows cracked, switch to Linux or just buy an Apple!

    Please, take this comment seriously! And please, stop with group buying, no matter what the benefit is. It won't work for long.

    Hi mate

    Fact is that most of the laptop manufacturers sell the computer and laptop computer with a preinstalled operating system. So I wouldn't blame Toshiba or other brands for which

    You get a new computer/laptop with a new OS.
    During the past 20 years, Microsoft released 3.0 Win, Win 95, Win 98, Win NT, W2k, Win XP, Win ME, Vista and Win 7, I remember that all my computers or laptops were grouped with these operating systems

    Toshiba offers the notebook with a clean image and you can also create a recovery disk (so don t need to buy anything if you need t n)
    Of course, each of us can install a clean OS, but there are a lot of people who are happy with such image pre-installed because everything is pre-installed and configured.

    Many people have no knowledge of computer wide and are really recognizing that everything is pre-installed and the configuration does not have a lot of time

    With regard to the question of the laptop;
    What to say; you had a bad luck that something was wrong with the laptop. This can still happen that my new LCD TV other manufacturer, was dead after two weeks, I called ASP, then replaced the screen now is ok

  • Some PDFS are print with empty boxes, replacing the text

    I have some of my electricity and gas supplier invoices and invoices are printed with squares displayed instead of text. I have already restored the book of fonts for the default fonts. I have no problem with the display of these bills on my computer. I have another PDF files and they all are printed correctly. If I open the PDF file that is badly printed and export it to PDF in PREVIEW app, the output is the same as on my printer. I tried to restore all the fonts by default those and I tried to reinstall OSX update with update combo, always the same.

    What else can I do to restore the normal print mode?

    Any who have had the same issue guys?

  • Can anyone confirm that groups of Nik Collection plug-in filters are compatible with 13 PS elements? Thank you

    I am considering the purchase of 13 PS both the Nik Collection of Google - plug-in filters for use with PS Elements. The Collection of Nik is a package of 6-7 groups of plug-in filters. Someone told me that NOT ALL the Nik plug-ins filters are compatible with PS 13 items. I thought I would ask the source. Can anyone confirm that groups of Nik Collection plug-in filters are compatible with 13 PS elements? Thank you

    Hi jimc,

    HDR Efex Pro 2 is the only group of plugin is not compatible with Photoshop Element 9 to 13, still other groups plugin works fine with Photoshop elements 13.

    See link: Google Nik Collection

    It will be useful.

    Kind regards

    ~ Mohit

  • Why none of the mobile applications are compatible with my Samsung Galaxy Note 10.1 Tablet? I can only use some of the mobile applications with my Samsung Galaxy Note 4

    Each Adobe Mobile App I want to install from the game store Android Google indicates that it is not compatible with my Samsung Galaxy Note 10.1 tablet, but some are compatible with my phone Samsung Galaxy Note 4. I prefer to use mobile apps on my tablet on not on my phone. Can someone explain why I can't use mobile apps on my tablet. I thought that mobile applications are compatible with the tablets and phones?

    Please refer to why none of the mobile applications are compatible with my Samsung Galaxy Note 10.1 Tablet? I can only use some of the mobile applications with my Samsung Galaxy Note 4

    (Double Post)

  • I installed the trial version of LR6. In developer mode, all the pictures are black with some coloured points/line, as a kind of negative

    I installed the trial version of LR6. In developer mode, all the pictures are black with coloured points/line, as a kind of negative. I deleted lR6 and installed again but no change. Who has an advisor?

    Try to disable the GPU under Edit > Preferences > performance. (Lightroom > Preferences on Mac)

    Uncheck the box use Graphics Processor.

  • Photo constantly order of photos in a slideshow changes no matter how many times the movements of the user the photo back to the good look at an order. Example: Bathroom Plans eventually grouped with pictures of kitchen! I have found no way to stop this o

    Apple Photo 1.3 serious problems - how can I SOLVE all these problems?

    (1) breaks down without rhyme or reason no matter where I am in the workflow.

    (2) pictures will not be Shut Down Every Time, even after several days of waiting.

    (3) aPhoto frequently badly chooses picture in the EDIT picture option, I get a picture different than the one I clicked on which is on a 100 pictures in a row.

    (4) picture constantly order of photos in a slideshow changes no matter how many times the movements of the end user the photo back to the good look at an order. Example: Bathroom Plans eventually grouped with pictures of kitchen! I have found no way to stop this weird behavior! Is there a way to stop this? If I drag the photo again some 7 additional photos in the slide show, after a minute or less, he appears again to where it was it not. !@#$%$#

    (5) If you make any CHANGES to a photo, it often changes the appearance of your complete slideshow of this picture with impatience. So you lose all this not work fix your configuration of the slide show. Even changing the order of photos once more that I had put back where they should be. !@#$$#@

    (6) photo identifies often shades of lamps and long door handles as the faces of the people.

    (7) photo made bad decisions when it comes to brightness, contrast and colors effortlessly around other than to use other software, where as with iPhoto there was a lot of workarounds. I could continue, but will save one who might be reading of this.

    I am up to date on all updates for my Mac. If anyone have REAL answers so please spilling the beans, but according to me, it's the only truth is that Apple has rolled out a product inferrer to replace an exceptional product, called iPhoto, which does not work on my new iMac computer 5K of 27 ".   If I knew what I would have chosen another computer that I use iPhoto to prepare more of fifty to sixty thousand photos in a given year and I use iPhoto to make hundreds of slideshows from it.  Are there plugins for Photo 1.3? I ask because I see where there could be Add-ons, but I can't find.

    Apple has taken a serious decision by turning his back to iPhoto and tens of millions of loyal users.

    Thanks in advance to anyone brave enough to tackle this job.

    James

    First, back up your library of Photos and hold down the command and option keys while launching Photos - repair your database - you have a corrupted database

    LN

  • "I am trying to install Xampp win32 - 1.7.7 I get a message saying" because an active user account on your system user account some features of XAMPP are probably limited. »

    "I am trying to install Xampp win32 - 1.7.7 on my windows 7, but it displays a quick message saying" because an active user account on your system user account some features of XAMPP are probably limited. with UAC, please avoid to install XAMPP in C:\program files (missing permissions). Or disable UAC with msconfig after this installation. " What does mean? and what do I do to install the software?

    original title: Troubleshooting

    Hi, Sabri,

    Try this

    -In Vista, you must be logged on as administrator and also to disable UAC (User Account Control), as it restricts certain administrative functions necessary to the functioning of a web server - you will be an administrator of the web server after the installation of XAMPP.

    Install XAMPP in the root of a drive or a partition, for example to the C:\ drive so you end up with all of C:\xampp installation files - do not install XAMPP in a folder with a space in name and remember that all things in XAMPP are case-sensitive.

    To turn off UAC, go to
    Start > Control Panel > user accounts
    you will find an option
    Enable or disable the User Account Control
    just click on it and uncheck the box
    User account control to help protect your computer
    Click OK.

    If you also have IIS installed and active, then you won't be able to run XAMPP on port 80 and SSL on port 443.

    Simply disable IIS you won't need it if you are installing XAMPP and Apache.
    To disable IIS, go on
    Start > Control Panel > programs and features
    on the far left, you will find an option
    Turn on or off Windows features
    Click on it and uncheck the box
    Internet Information Services
    Click OK
    and then restart your computer.

    http://www.apachefriends.org/f/viewtopic.php?f=16&t=45364

  • Some of function boxes are elongated and may not reach the OK box

    original title: Windows Vista - Control Panel customization to enlarge the font size.  Some of function boxes are elongated and may not reach the OK box

    Using Windows Vista. I used the customization Panel control to enlarge the font size.  I discovered that some boxes, like Adobe Reader Print and function, in effect, the Personaization (to reduce the font size to original size) require a click OK. But the box frame with large font size, is elongated until I can't get the OK.  How to get to the OK or reduce the size of the police without the OK?

    Simply press enter instead of OK.

  • What are users with Cisco 802.11n 802.11ac WLAN APs running on Low Power?

    Experts Sars WLAN,

    I'm new on a big installation WLAN here and noticed that not only the AIR-CAP2702I-E-K9 communicate on the Management Station first central and many changes of low-power 2.4 GHz antenna power level.

    People here tell me that it is not harmful, but I am slightly dubious and would like your opinion here.

    WLAN access points are activated with 2.4 and 5 GHz-antennas and shoot only 15.4 Watt following switch.

    Interface Admin Oper Power (Watts) class of device
    Of the PS to the device
    --------- ------ ---------- ---------- ---------- ------------------- -----

    Ba3/4 auto on 17.3 15.4 4 AIR-CAP2702I-E-K9

    First is revealing:

    "APis running on Low Power." Please disable Radio one and reset the access point to get full power on the other radio. »

    The access point is configured for 802.11n on both bands and 802.11ac on 5 GHz.

    I can also see many Power Level change on the 2.4 Ghz antenna.

    Here people are complaining about downtime on laptops for SAP applications.

    Also a voice over WLAN installation does not work very well.

    But I don't know if this has something to do with low power.

    What are the consequences for WLAN users in this scenario?

    Changes in the level of power can cause interruptions to users of WIFI?

    Is 'Low-Power' - Situation responsible for a large amount of sending changes to feeding on 2.4 GHz?

    Who knows more and has experience with low-power facilities?

    Thank you for any comments on this

    Wini

    Just to add

    What are the consequences for WLAN users in this scenario?

    * Anything, just change really the number of antennas is used

    Changes in the level of power can cause interruptions to users of WIFI?

    * Change in power level, do not make changes to string

    Is 'Low-Power' - Situation responsible for a large amount of sending changes to feeding on 2.4 GHz?

    * No.

    Who knows more and has experience with low-power facilities?

    You should focus on your environment and what you see. With low power due to the PoE does not affect the user experience.  If your access point changes the power too high or too low, you can introduce some poor duplication of coverage or channel.  If you are also in a building/space tenant shared, other installs nearby Wireless will affect your RF and yours will have an impact on their. Nothing we can do.  You must set customer issues before assuming what is wrong, that nothing could be wrong.  The updated client drivers is also a good thing to do to eliminate this problem.

    -Scott

    Please evaluate the useful messages *.

  • Scrolling group problem: not all the group with scrolling content?

    Helloooow peoplez script wise.

    I was biting my nails on this problem, the last two days and still have not found a solution. Go here:

    I tried to make a window (or Panel actually, because ultimately it must be run from the EI > window > scriptname.jsx), with a scroll bar, which can scroll content in a group beside him. I can get the scroll and all group, but is the problem, just now, that the elements of x in the group, the last get cut. Like this (it is supposed to be 500 buttons):

    Screen Shot 2015-10-13 at 21.40.05.png

    The only way that I was able to get the 'internal' group grow is by not using do not align properties and manually set the .size. I know that the content is here because the last element arises, when I move the last location of points [1] upwards until he reached the top of the group. I tried to refresh the page layout (layout.layout (true); layout.resize (()) to each call of the function onChanging() of the cursor, but without success. Read a lot of forum posts beautiful and discussion by @Marc Autret and other users of scriptUI/extendscript long has this far been without success.

    TL; DR: I'm doing a group with a lot of content that I can scroll with a scroll bar.

    Here is the code snippet, I hope fairly well commented:

    {
    //scroller test
    // uncomment the temp path (replace with some image file path) and the lines inside the populateGrid() function to reproduce my problem better
    // I'm ussing an image 512x288 pixels
    
    
    //var tempPath = "/Volumes/Verbinski/02_SCRIPTING/After_Effects/stockholm/ROOT/EXPLOSIONS/Fireball_side_01/Thumbs/Fireball_Side_01_024.jpg";
    
    
    // create window
    var mWin = new Window('palette');
      mWin.size = [500,500];
      mWin.orientation = 'row';
    
    
    // If you like it, then you better put a scroller on it.
    var scroller = mWin.add('ScrollBar');
      scroller.size = [20,mWin.size[1]-40]
      scroller.minvalue = -5;
      scroller.value = scroller.minvalue;
      scroller.maxvalue = 10000; // tried changing this to all sorts of interesting numbers.
    
    
    //This should move the group, created further down.
    scroller.onChanging = function(){
      grid.location = [grid.location[0],-scroller.value];
    }
    
    
    // "Boundary" for grid (see below)
    var gridArea = mWin.add('panel',undefined,'gridArea');
      gridArea.size = [mWin.size[0]-40,mWin.size[1]-40];
    
    
    // The grid... a digital fronteer... and also container of stuff
    var grid = gridArea.add('panel',undefined,'grid');
      grid.size = [gridArea.size[0]-20,9000000000] // no matter how high I put this, it doesn't change a thing
    
    
    // Just an array for all the images to go
    var clips = [];
    // Total height gets calculated in the populateGrid function.
    var totalHeight = 0;
    
    
    function populateGrid(rows){
      var img;
      for(i=0;i<rows;i++){
      // img = grid.add('image',undefined,tempPath);
      // clips.push(img);
      grid.add('button',undefined,i);
      }
      for(i in clips){
      clips[i].location = [0,(clips[i].image.size[1]*i)]
      }
      // totalHeight = (img.image.size[1]+grid.spacing)*rows;
      // grid.size = [grid.size[0],totalHeight]
      // scroller.maxvalue = totalHeight/2;
    
    
    }
    
    
    // put x number of buttons/images into the grid
    populateGrid(500);
    
    
    // shwo to window
    mWin.show();
    mWin.center();
    }
    

    Reaally hope someone here sees this and can help out me.

    Cheers, Fynn.

    My Control Panel:

    retina 5K, 4 GHz Intel Core i7 iMac

    32 GB of RAM, 512 GB SSD HARD drive

    OSX Yosemite: 10.10.4

    AE: CS6 |  CC 2014: 13.1.1.3

    Aaalrighty, guys. It seems to me have cracked... Sort of...

    David, your version worked quite well, I just modified a bit to get the right calculation.

    The wheel now works as expected and the scroller.maxvalue is calculated as ((number of items) * height of the first item).

    Everything works fine until I have started using the automatic layout manager. The option 'fill' at least makes it really hard to understand the final height of the internal objects. So they must be defined accordingly.

    Indeed, here is my modified code (sorry, @David for resources according to the version string, you may simply copy the scroller.onChanging () and populateGrid() x parts))

    {
    //scroller test
    // I'm using an image of around 512x288 pixels
    
    var tempPath = "YOUR IMAGE HERE";
    
    // create window
    var mWin = new Window('palette');
      mWin.size = [500,500];
      mWin.orientation = 'row';
    
    // If you like it, then you better put a scroller on it.
    var scroller = mWin.add('ScrollBar');
      scroller.size = [20,mWin.size[1]-40]
      scroller.minvalue = 0;
      scroller.value = scroller.minvalue;
      scroller.maxvalue = 3000; // tried changing this to all sorts of interesting numbers.
    
    //This should move the group, created further down.
    var scrollDiary = 0;
    scroller.onChanging = function(){
      var scrollVal = Math.abs(scroller.value)-scrollDiary;
      for(i=0;i		   
  • [8i] grouping with delicate conditions (follow-up)

    I am posting this as a follow-up question to:
    [8i] grouping with tricky conditions

    This is a repeat of my version information:
    Still stuck on an old database a little longer, and I'm trying out some information...

    BANNER

    --------------------------------------------------------------------------------
    Oracle8i Enterprise Edition Release 8.1.7.2.0 - Production
    PL/SQL Release 8.1.7.2.0 - Production
    CORE 8.1.7.0.0-Production
    AMT for HP - UX: 8.1.7.2.0 - Production Version
    NLSRTL Version 3.4.1.0.0 - Production

    Now for the sample data. I took an order of my real data set and cut a few columns to illustrate how the previous solution didn't find work. My real DataSet still has thousands of orders, similar to this one.
    CREATE TABLE     test_data
    (     item_id     CHAR(25)
    ,     ord_id     CHAR(10)
    ,     step_id     CHAR(4)
    ,     station     CHAR(5)
    ,     act_hrs     NUMBER(11,8)
    ,     q_comp     NUMBER(13,4)
    ,     q_scrap     NUMBER(13,4)
    );
    
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0005','S509',0,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0010','S006',0,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0020','A501',0.85,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0026','S011',0.58,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0030','S970',0,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0040','S970',0,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0050','S003',0,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0055','S600',0,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0060','Z108',6.94,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0070','Z108',7,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0080','Z310',4.02,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0085','Z409',2.17,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0090','S500',0.85,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0095','S502',1.63,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0110','S006',0,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0112','S011',0.15,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0117','S903',0,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0118','S900',0,9,1);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0119','S950',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0120','S906',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0140','S903',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0145','S950',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0150','S906',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0160','S903',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0170','S900',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0220','S902',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0230','S906',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0240','S903',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0250','S003',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0260','S006',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0270','S012',0.95,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0280','Z417',0.68,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0285','Z417',0.68,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0290','Z426',1.78,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0300','Z426',2.07,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0305','Z426',1.23,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0310','Z402',3.97,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0315','Z308',8.09,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0410','Z409',4.83,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0430','S500',3.6,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0435','S502',0.43,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0450','S002',0.35,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0460','S001',1,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0470','Z000',2.6,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0476','S011',1,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0478','S510',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0480','S903',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0490','S003',1.2,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0500','S500',1.37,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0530','B000',0.28,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0536','S011',0.65,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0538','S510',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0540','S923',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0560','S003',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0565','S001',0.85,0,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0570','S012',2.15,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0575','S509',0,0,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0580','B000',3.78,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0590','S011',0.27,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0001715683','0600','S510',0,9,0);
    Instead of grouping all sequential steps with 'OUTPR' station, I am gathering all the sequential steps with "S9%" station, then here is the solution changed to this:
    SELECT       item_id
    ,        ord_id
    ,       MIN (step_id)          AS step_id
    ,       station
    ,       SUM (act_hrs)          AS act_hrs
    ,       MIN (q_comp)          AS q_comp
    ,       SUM (q_scrap)          AS q_scrap
    FROM       (          -- Begin in-line view to compute grp_id
               SELECT  test_data.*
               ,           ROW_NUMBER () OVER ( PARTITION BY  item_id, ord_id
                                                ORDER BY        step_id
                              )
                  - ROW_NUMBER () OVER ( PARTITION BY  item_id, ord_id
                                          ,                CASE
                                            WHEN  station LIKE 'S9%'
                                            THEN  NULL
                                            ELSE  step_id
                                           END
                                ORDER BY      step_id
                              )     AS grp_id
               ,           ROW_NUMBER () OVER ( PARTITION BY  item_id, ord_id
                                                ORDER BY        step_id
                              )                    AS r_num1
               ,       ROW_NUMBER () OVER ( PARTITION BY  item_id, ord_id
                                          ,                CASE
                                            WHEN  station LIKE 'S9%'
                                            THEN  NULL
                                            ELSE  step_id
                                           END
                                ORDER BY      step_id
                              )                    AS r_num2
               FROM    test_data
           )          -- End in-line view to compute grp_id
    GROUP BY  item_id
    ,            ord_id
    ,       station
    ,       grp_id
    ORDER BY  item_id
    ,            step_id
    ;
    If just run the subquery to calculate grp_id, you can see that it sometimes affects the same number of group in two stages that are not side by side. For example, the two step 285 and 480 are they assigned group 32...

    I don't know if it's because my orders have many more steps that the orders of the sample I provided, or what...

    I tried this version too (by replacing all the names of the stations "S9%" by "OUTPR"):
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0005','S509',0,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0010','S006',0,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0020','A501',0.85,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0026','S011',0.58,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0030','OUTPR',0,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0040','OUTPR',0,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0050','S003',0,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0055','S600',0,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0060','Z108',6.94,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0070','Z108',7,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0080','Z310',4.02,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0085','Z409',2.17,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0090','S500',0.85,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0095','S502',1.63,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0110','S006',0,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0112','S011',0.15,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0117','OUTPR',0,10,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0118','OUTPR',0,9,1);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0119','OUTPR',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0120','OUTPR',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0140','OUTPR',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0145','OUTPR',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0150','OUTPR',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0160','OUTPR',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0170','OUTPR',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0220','OUTPR',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0230','OUTPR',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0240','OUTPR',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0250','S003',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0260','S006',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0270','S012',0.95,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0280','Z417',0.68,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0285','Z417',0.68,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0290','Z426',1.78,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0300','Z426',2.07,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0305','Z426',1.23,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0310','Z402',3.97,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0315','Z308',8.09,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0410','Z409',4.83,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0430','S500',3.6,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0435','S502',0.43,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0450','S002',0.35,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0460','S001',1,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0470','Z000',2.6,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0476','S011',1,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0478','S510',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0480','OUTPR',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0490','S003',1.2,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0500','S500',1.37,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0530','B000',0.28,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0536','S011',0.65,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0538','S510',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0540','OUTPR',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0560','S003',0,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0565','S001',0.85,0,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0570','S012',2.15,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0575','S509',0,0,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0580','B000',3.78,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0590','S011',0.27,9,0);
    INSERT INTO test_data
    VALUES ('abc-123','0009999999','0600','S510',0,9,0);
    
    
    SELECT       item_id
    ,        ord_id
    ,       MIN (step_id)          AS step_id
    ,       station
    ,       SUM (act_hrs)          AS act_hrs
    ,       MIN (q_comp)          AS q_comp
    ,       SUM (q_scrap)          AS q_scrap
    FROM       (          -- Begin in-line view to compute grp_id
               SELECT  test_data.*
               ,           ROW_NUMBER () OVER ( PARTITION BY  item_id, ord_id
                                                ORDER BY        step_id
                              )
                  - ROW_NUMBER () OVER ( PARTITION BY  item_id, ord_id
                                          ,                CASE
                                            WHEN  station = 'OUTPR'
                                            THEN  NULL
                                            ELSE  step_id
                                           END
                                ORDER BY      step_id
                              )     AS grp_id
               ,           ROW_NUMBER () OVER ( PARTITION BY  item_id, ord_id
                                                ORDER BY        step_id
                              )                    AS r_num1
               ,       ROW_NUMBER () OVER ( PARTITION BY  item_id, ord_id
                                          ,                CASE
                                            WHEN  station = 'OUTPR'
                                            THEN  NULL
                                            ELSE  step_id
                                           END
                                ORDER BY      step_id
                              )                    AS r_num2
               FROM    test_data
           )          -- End in-line view to compute grp_id
    GROUP BY  item_id
    ,            ord_id
    ,       station
    ,       grp_id
    ORDER BY  item_id
    ,            step_id
    ;
    and it shows the same problem.

    Help?

    Hello

    I'm glad that you understood the problem.

    Here's a little explanation of the approach of the fixed difference. I can refer to this page later, so I will explain some things you obviously already understand, but I jump you will find helpful.
    Your problem has additional feature that, according to the station, some lines can never combine in large groups. For now, we will greatly simplify the problem. In view of the CREATE TABLE statement, you have posted and these data:

    INSERT INTO test_data (item_id, ord_id, step_id, station)  VALUES ('abc-123', '0001715683', '0010', 'Z417');
    INSERT INTO test_data (item_id, ord_id, step_id, station)  VALUES ('abc-123', '0001715683', '0011', 'S906');
    INSERT INTO test_data (item_id, ord_id, step_id, station)  VALUES ('abc-123', '0001715683', '0012', 'S906');
    INSERT INTO test_data (item_id, ord_id, step_id, station)  VALUES ('abc-123', '0001715683', '0140', 'S906');
    INSERT INTO test_data (item_id, ord_id, step_id, station)  VALUES ('abc-123', '0001715683', '0170', 'Z417');
    INSERT INTO test_data (item_id, ord_id, step_id, station)  VALUES ('abc-123', '0001715683', '0175', 'Z417');
    INSERT INTO test_data (item_id, ord_id, step_id, station)  VALUES ('abc-123', '0001715683', '0200', 'S906');
    INSERT INTO test_data (item_id, ord_id, step_id, station)  VALUES ('abc-123', '0001715683', '0205', 'S906');
    

    Let's say that we want this output:

    `                  FIRST LAST
                       _STEP _STEP
    ITEM_ID ORD_ID     _ID   _ID   STATION  CNT
    ------- ---------- ----- ----- ------- ----
    abc-123 0001715683 0010  0010  Z417       1
    abc-123 0001715683 0011  0140  S906       3
    abc-123 0001715683 0170  0175  Z417       2
    abc-123 0001715683 0200  0205  S906       2
    

    Where each line of output represents a contiguous set of rows with the same item_id, ord_id and station. "Contguous" is determined by step_id: lines with "0200" = step_id = step_id "0205' are contiguous in this example of data because there is no step_ids between '0200' and '0205". "
    The expected results include the step_id highest and lowest in the group, and the total number of original lines of the group.

    GROUP BY (usually) collapses the results of a query within lines. A production line can be 1, 2, 3, or any number of lines in the original. This is obviously a problem of GROUP BY: we sometimes want several lines in the original can be combined in a line of output.

    GROUP BY guess, just by looking at a row, you can tell which group it belongs. Looking at all the 2 lines, you can always know whether or not they belong to the same group. This isn't quite the case in this issue. For example, these lines

    INSERT INTO test_data (item_id, ord_id, step_id, station)  VALUES ('abc-123', '0001715683', '0140', 'S906');
    INSERT INTO test_data (item_id, ord_id, step_id, station)  VALUES ('abc-123', '0001715683', '0200', 'S906');
    

    These 2 rows belong to the same group or not? We cannot tell. Looking at just 2 lines, what we can say is that they pourraient belonging to the same group, since they have the same item_id, ord_id and station. It is true that members of same groups will always be the same item_id, the ord_id and train station; If one of these columns differ from one line to the other, we can be sure that they belong to different groups, but if they are identical, we cannot be certain that they are in the same group, because item_id, ord_id and station only tell part of the story. A group is not just a bunch or rows that have the same item_id, ord_id and station: a group is defined as a sequence of adjacent to lines that have these columns in common. Before we can make the GROUP BY, we need to use the analytical functions to see two lines are in the same contiguous streak. Once we know that, we can store this data in a new column (which I called grp_id), and then GROUP BY all 4 columns: item_id, ord_id, station and grp_id.

    First of all, let's recognize a basic difference in 3 columns in the table that will be included in the GROUP BY clause: item_id, ord_id and station.
    Item_id and ord_id always identify separate worlds. There is never any point comparing lines with separate item_ids or ord_ids to the other. Different item_ids never interact; different ord_ids have nothing to do with each other. We'll call item_id and ord_id column 'separate world '. Separate planet do not touch each other.
    The station is different. Sometimes, it makes sense to compare lines with different stations. For example, this problem is based on questions such as "these adjacent lines have the same station or not? We will call a "separate country" column of the station. There is certainly a difference between separate countries, but countries affect each other.

    The most intuitive way to identify groups of contiguous lines with the same station is to use a LAG or LEAD to look at adjacent lines. You can certainly do the job, but it happens to be a better way, using ROW_NUMBER.
    Help the ROW_NUMBER, we can take the irregular you are ordering step_id and turn it into a dial of nice, regular, as shown in the column of r_num1 below:

    `                                 R_             R_ GRP
    ITEM_ID ORD_ID     STEP STATION NUM1 S906 Z417 NUM2 _ID
    ------- ---------- ---- ------- ---- ---- ---- ---- ---
    abc-123 0001715683 0010 Z417       1         1    1   0
    abc-123 0001715683 0011 S906       2    1         1   1
    abc-123 0001715683 0012 S906       3    2         2   1
    abc-123 0001715683 0140 S906       4    3         3   1
    abc-123 0001715683 0170 Z417       5         2    2   3
    abc-123 0001715683 0175 Z417       6         3    3   3
    abc-123 0001715683 0200 S906       7    4         4   3
    abc-123 0001715683 0205 S906       8    5         5   3
    

    We could also assign consecutive integers to the lines in each station, as shown in the two columns, I called S906 and Z417.
    Notice how the r_num1 increases by 1 for each line to another.
    When there is a trail of several rows of S906 consectuive (for example, step_ids ' 0011 'by '0140'), the number of s906 increases by 1 each line to another. Therefore, during the duration of a streak, the difference between r_num1 and s906 will be constant. For 3 lines of the first series, this difference is being 1. Another series of S906s contiguous started step_id = '0200 '. the difference between r_num1 and s906 for this whole series is set to 3. This difference is what I called grp_id.
    There is little meaning for real numbers, and, as you have noticed, streaks for different stations can have as by chance the same grp_id. (it does not happen to be examples of that in this game of small sample data.) However, two rows have the same grp_id and station if and only if they belong to the same streak.

    Here is the query that produced the result immediately before:

    SELECT    item_id
    ,        ord_id
    ,        step_id
    ,       station
    ,       r_num1
    ,       CASE WHEN station = 'S906' THEN r_num2 END     AS s906
    ,       CASE WHEN station = 'Z417' THEN r_num2 END     AS Z417
    ,       r_num2
    ,       grp_id
    FROM       (          -- Begin in-line view to compute grp_id
               SELECT  test_data.*
               ,           ROW_NUMBER () OVER ( PARTITION BY  item_id, ord_id
                                                ORDER BY        step_id
                              )
                  - ROW_NUMBER () OVER ( PARTITION BY  item_id, ord_id, station
                                ORDER BY      step_id
                              )     AS grp_id
               ,           ROW_NUMBER () OVER ( PARTITION BY  item_id, ord_id
                                                ORDER BY        step_id
                              )                    AS r_num1
               ,       ROW_NUMBER () OVER ( PARTITION BY  item_id, ord_id, station
                                ORDER BY      step_id
                              )                    AS r_num2
               FROM    test_data
           )          -- End in-line view to compute grp_id
    ORDER BY  item_id
    ,            ord_id
    ,       step_id
    ;
    

    Here are a few things to note:
    All analytical ORDER BY clauses are the same. In most of the problems, there will be only an ording regime that matters.
    Analytical PARTITION BY clauses include the columns of 'distinct from the planet', item_id and ord_id.
    The analytical PARTITION BY clauses also among the column 'split the country', station.

    To get the results we want in the end, we add a GROUP BY clause from the main query. Yet once, this includes the columns of the 'separate world', column 'split the country', and the column 'fixed the difference', grp_id.
    Eliminating columns that have been includied just to make the output easier to understand, we get:

    SELECT    item_id
    ,        ord_id
    ,        MIN (step_id)          AS first_step_id
    ,       MAX (step_id)          AS last_step_id
    ,       station
    ,       COUNT (*)          AS cnt
    FROM       (          -- Begin in-line view to compute grp_id
               SELECT  test_data.*
               ,           ROW_NUMBER () OVER ( PARTITION BY  item_id, ord_id
                                                ORDER BY        step_id
                              )
                  - ROW_NUMBER () OVER ( PARTITION BY  item_id, ord_id, station
                                ORDER BY      step_id
                              )     AS grp_id
               FROM    test_data
           )          -- End in-line view to compute grp_id
    GROUP BY  item_id
    ,            ord_id
    ,       station
    ,       grp_id
    ORDER BY  item_id
    ,            ord_id
    ,       first_step_id
    ;
    

    This prioduces the output displayed much earlier in this message.

    This example shows the fixed difference indicated. Specific problem you is complicated a little what you should use an expression BOX based on station rather than the station iteself.

  • Groups with overlapping intervals

    Hello

    I need help on a problem of mind-boggling overlap, or perhaps overlap problem.

    The data in the example below, I need to set up different subcodes in groups with overlapping
    [MIN_VAL intervals; [MAX_VAL


    I have this table:
    SQL>create table t (product   varchar2(1) not null
      2                 ,subcode   number(1)   not null, constraint subcode_chk check (subcode >= 0)
      3                 ,min_val   number(2)   not null, constraint min_val_chk check (min_val >= 0)
      4                 ,max_val   number(2)   not null, constraint max_val_chk check (max_val >= 0)
      5                 ,constraint t_pk primary key (product, subcode)
      6                 ,constraint t_val_chk check (min_val < max_val));
    
    Table created.
    
    SQL>
    SQL>insert into t (product, subcode, min_val, max_val) values ('A', 0, 0, 99);
    
    1 row created.
    
    SQL>insert into t (product, subcode, min_val, max_val) values ('A', 1, 0, 99);
    
    1 row created.
    
    SQL>insert into t (product, subcode, min_val, max_val) values ('A', 2, 18, 67);
    
    1 row created.
    
    SQL>insert into t (product, subcode, min_val, max_val) values ('A', 3, 20, 65);
    
    1 row created.
    
    SQL>insert into t (product, subcode, min_val, max_val) values ('A', 4, 0, 99);
    
    1 row created.
    
    SQL>insert into t (product, subcode, min_val, max_val) values ('A', 5, 45, 60);
    
    1 row created.
    
    SQL>insert into t (product, subcode, min_val, max_val) values ('A', 6, 20, 40);
    
    1 row created.
    
    SQL>insert into t (product, subcode, min_val, max_val) values ('A', 7, 0, 99);
    
    1 row created.
    
    SQL>insert into t (product, subcode, min_val, max_val) values ('A', 8, 60, 65);
    
    1 row created.
    
    SQL>insert into t (product, subcode, min_val, max_val) values ('A', 9, 0, 99);
    
    1 row created.
    
    SQL>commit
      2  /
    
    Commit complete.
    
    SQL>
    SQL>  select product, subcode, min_val, max_val
      2      from t
      3     where product = 'A'
      4  order by product, subcode;
    
    PRODUCT    SUBCODE    MIN_VAL    MAX_VAL
    ------- ---------- ---------- ----------
    A                0          0         99
    A                1          0         99
    A                2         18         67
    A                3         20         65
    A                4          0         99
    A                5         45         60
    A                6         20         40
    A                7          0         99
    A                8         60         65
    A                9          0         99
    
    10 rows selected.
    
    SQL>
    Records of interest are the subcodes 5,6,8 since they in some cases can be considered as a subcode.

    It's OK, that a record MAX_VAL = MIN_VAL from any other folder. The main thing is that the sous-codes
    within a group are reciprocal to disclose on MIN_VAL, MAX_VAL.
    SQL>  select product, subcode, min_val, max_val
      2      from t
      3     where product = 'A'
      4       and subcode in (5,6,8)
      5  order by min_val;
    
    PRODUCT    SUBCODE    MIN_VAL    MAX_VAL
    ------- ---------- ---------- ----------
    A                6         20         40
    A                5         45         60
    A                8         60         65
    
    SQL>
    I started trying to solve using functions lag/lead Analytics, but without success.

    Then I came up with this hierarchical query, but I don't understand it myself and bothers me!

    SQL>    select distinct -- This, distinct, bothers me!
      2                      product
      3                     ,subcode
      4                     ,min_val
      5                     ,max_val
      6  --                   ,connect_by_isleaf
      7  --                   ,connect_by_root subcode
      8        from t
      9       where connect_by_isleaf = 1 -- Why does this help me?
     10  start with -- This, start with, seems "clumpsy"
     11            min_val in (  select min_val
     12                            from t
     13                        group by product, subcode, min_val)
     14  connect by nocycle -- This, nocycle, really bothers me!
     15                     min_val > prior min_val
     16                 and max_val <= prior max_val
     17                 and product = prior product
     18                 and subcode <> prior subcode
     19    order by product
     20            ,subcode
     21            ,min_val
     22            ,max_val;
    
    PRODUCT    SUBCODE    MIN_VAL    MAX_VAL
    ------- ---------- ---------- ----------
    A                5         45         60
    A                6         20         40
    A                8         60         65
    
    SQL>
    Currently, I am struggling with only identify the three subcodes. In the perfect world that would be better

    PRODUCT    SUBCODE    MIN_VAL    MAX_VAL   GROUP_FLAG
    ------- ---------- ---------- ----------   ----------
    A                0          0         99
    A                1          0         99
    A                2         18         67
    A                3         20         65
    A                4          0         99
    A                5         45         60            1
    A                6         20         40            1
    A                7          0         99
    A                8         60         65            1
    A                9          0         99
    Or better yet, if you use the herarchial query:
    PRODUCT    SUBCODE    MIN_VAL    MAX_VAL   ROOT_SUBCODE
    ------- ---------- ---------- ----------   ------------
    A                0          0         99              0
    A                1          0         99              1
    A                2         18         67              2
    A                3         20         65              3
    A                4          0         99              4
    A                5         45         60              6
    A                6         20         40              6
    A                7          0         99              7
    A                8         60         65              6
    A                9          0         99              9
    Any help and inspiration would be much appreciated. But please do not get offended if I'm not up to the next 12-14 hrs.

    Concerning
    Peter
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    Published by: Peter on May 19, 2009 12:52
    -Change line 15 of hierarchical query

    Hi, Peter,.

    I'm not sure that understand what you're trying to do.
    It may be useful to know
    (1) what is your concept of 'group' to this problem? In what sense subcodes 5, 6 and 8 form a group? This is what they have in common the quality of not overlapping with a few rows with the same product? In other words, there will be no more than two groups by product: the lines that overlap with all other ranks and the lines which are not?
    (2) what you mean by "disclosing each other?" Is that what the max_val min_val beaches do not overlap?

    If you want to identify the subcodes for which there is an another product with the same subcode but non-overlapping min_val and max_val, then:

    SELECT     *
    FROM     t     m
    WHERE     EXISTS (
                     SELECT  NULL
                 FROM        t
                 WHERE   product =  m.product
                 AND        (        min_val > m.max_val
                         OR        max_val < m.min_val
                      )
                );
    

    This requires that min_val<= max_val="" on="" each="">

    The rest of this message is the request CONNECT BY you posted, in case you want to understand it better.

    When I run the CONNECT BY query you posted, I get these results:

    P    SUBCODE    MIN_VAL    MAX_VAL
    - ---------- ---------- ----------
    A          0          0         99
    A          1          0         99
    A          4          0         99
    A          5         45         60
    A          6         20         40
    A          7          0         99
    A          8         60         65
    A          9          0         99
    

    The START WITH clause includes all lines: you might as well not have a START WITH clause:

     10  start with -- This, start with, seems "clumpsy"
     11            min_val in (  select min_val
     12                            from t
     13                        group by product, subcode, min_val)
    

    Since you are grouping OF min_val, the subquery produces a list of all the min_vals of the table.

    The clause CONNECT BY esteem line x to be the parent of line y if y min_val max_val beach is a subset of x:

     14  connect by nocycle -- This, nocycle, really bothers me!
     15                     min_val >= prior min_val
     16                 and max_val <= prior max_val
     17                 and product = prior product
     18                 and subcode <> prior subcode
    

    It's a kind of overlap, but much more strict.

    Is there a particular reason why NOCYCLE you mind here? As SEPARATE, NOCYCLE is often a sign of something that is awkward, but not an indicator course. Somehow, they are like tape canvas: most of the time when you see led piece of tape is used inappropriately, but that does not mean the appropriate uses do not exist.

    Because I'm not sure what you're trying to do, I'm not sure whether or not the WHERE clause allows:

      9       where connect_by_isleaf = 1 -- Why does this help me?
    

    It is certainly important. Without the WHERE clause, the output includes all lines. With the WHERE clause, the lines with the sous-codes 2 and 3 are excluded. Why? Because they always have children. Sub 2 (67-18) is the parent of 3 (20-65), and 3 is the parent of 5 (45-60), 6 (20-40) and 8 (60-65). (2 is also the parent of 5, 6 and 8, as well as their grandparents.)
    You can ask: what about the subcodes 0, 1 and 7: they still do not have children? Why they spend the WHERE clause? 0, 1 and 7 (ranging from 0 to 99) are the parents of all the other lines, including one from the other. Therefore, they will all be invloved in cycles and whenever CONNECT_BY_ISCYCLE = 1, CONNECT_BY_ISLEAF will also be 1, while 0, 1 and 7 have children, they do not always have children.

    Published by: Frank Kulash, May 19, 2009 13:07

  • How I check my Mac, applications are compatible with the Sierra?

    How can I ensure that my Mac, applications are compatible with Sierra FRONT update?

    I read that some applications may not work more on macOS Sierra abandoned because of the garbage man.  Only thing I found was to use the command terminal otool - oV Applications/PROGRAMMNAME.app/Contents/MacOS/PROGRAMMNAME | tail - 3 to verify an application but I'd have to type that in hundreds of applications - is not good.

    You can see http://roaringapps.com/apps?platform=osx.

    If you want to check your applications manually, you can run this AppleScript:

    paragraphs of the allApps value (the shell script ' find/Applications / - name \"*.app\ '-maxdepth 2 |" ") SED EI \"s/\\(.*\\)\\/\\([^\\/]*\\).app/\\2/g\" ")

    Set compatibleApps to {}

    Set incompatibleApps to {}

    Repeat with PAP in allApps

    set this to the script ' otool - oV "shell & city form of (' / Applications /" PAP ".app/Contents/MacOS/" & PAP) & "|" tail - 3"

    If this contains "OBJC_IMAGE_SUPPORTS_GC" then

    Copy at the end of incompatibleApps PAP

    on the other

    Copy at the end of compatibleApps PAP

    end if

    end repeat

    -If you want a dialog box to view the compatible/incompatible applications

    compatibleString the value «»

    incompatibleString the value «»

    Repeat with theItem in compatibleApps

    "the value compatibleString compatibleString & item &"

    "

    end repeat

    Repeat with theItem in incompatibleApps

    "the value incompatibleString incompatibleString & item &"

    "

    end repeat

    Tell me to display the dialog box "compatible apps:

    "& compatibleString

    Tell me to display the dialog box "incompatible apps:

    "& incompatibleString

Maybe you are looking for

  • My icons disappear

    I can create new folder icons in OSX 10.11.4, but when I transfer the file to the sidebar or are anchored it restores the credits - suggestions? Concerning Bernie C

  • Unable to connect to GFWL (event viewer - 0x8015190e) a previous error was 80072751

    I installed Bioshock 2 and GTA 4 EFLC yesterday and after signing of GFWL gave me a 80072751 error when he tried to update the game. After the search of these forums, I tried several things- Permitted by Windows Firewall Open ports on the router (eve

  • RETRIEVE DOCUMENTS AFTER A REBOOT

    I LOST ALL MY PHOTOS WHEN MY COMPUTER CRASHED ARE THEY ALWAYS IN THE COMPUTER SOMEWHRE

  • Internet Explorer crashes me download free avg

    having problem installing avg free if someone has an answer please let me know.                                                                                                                                                                           

  • "Failure of the printer: there is a problem with the printer or ink system" message

    I get printer error message on my printer Officejet 6700 Premium.  I'm on a Mac OSX 10.9.2. I have reset the printer and I tried to update the firmware by the instructions, but he tells me that the device is busy and won't.  The printer is out of war