Hierarchical DATA?

I KNOW WHAT IS hierarchical DATA
IN WHICH THE A RECORD HAVE A CHILD AND PARENT RELATION SHIP.
IN WHICH A RECORD SHOULD HAVE ONLY ONE PARENT DATA.
IS THIS RIGHT ANSWER??????
AND I CAN DISPLAY EMP TABLE RECORDS IN hierarchical MODEL
BUT THESE TABLES WILL HAVE THE EXACT MODEL OF hierarchical????????????
IF A TABLE HAVE ONLY hierarchical DATA HOW CAN I RETRIVE THAT DATA???????

I KNOW WHAT IS hierarchical DATA
IN WHICH THE A RECORD HAVE A CHILD AND PARENT RELATION SHIP.
IN WHICH A RECORD SHOULD HAVE ONLY ONE PARENT DATA.
Not Necessary...there can be many to many relationships also
IS THIS RIGHT ANSWER??????
AND I CAN DISPLAY EMP TABLE RECORDS IN hierarchical MODEL
BUT THESE TABLES WILL HAVE THE EXACT MODEL OF hierarchical????????????
What do you mean by "exact model of hierarchy". Plz ask questions clearly...
IF A TABLE HAVE ONLY hierarchical DATA HOW CAN I RETRIVE THAT DATA???????
If i understood your point, then I think you want to ask that if in a table, 2 columns are sharing dependency. Eg: empid and manager_id relationship in employee table. In this case also, we can retrive the data using connect by
select level, manager_id,empid
from employees
start with manager_id=null
connect by prior employee_id = manager_id
I hope this clarifies to you

Similar Messages

  • Wanna learn to implement hierarchical data structure

    I want to learn the method of handling hierarchical data in Java
    For instance if there is some kind of data which contains 6 main nodes then every node contains 2 sub nodes and there are 4 nodes under the 3rd node where as the 5th one contains two more subnodes one under another.
    So how will that be implemented?
    Ofcourse it must be possible to implement it but how can I do the same if I do not know the depth and number of nodes and will get it during the runtime?
    I had attempted to do create some thing of this kind using Turbo C++ 3.5 but after two weeks of intensive programming I was left utterly confused with innumerable pointers and pointer to pointers and pointer to a pointer to a pointers and more. At last it was me who forgot which pointer was pointing to what.

    Well, just start by making a Node class. To allow Nodes to have children, make each Node have an array (or arraylist, vector, etc.) of other Nodes.
    for example:
    class Node{
      private ArrayList<Node> children;
    }Put whatever else you need in there.
    You can then traverse these through methods you write, to return child nodes. If you need the Nodes to have knowledge of their parents, add a Node parent; variable in your Node class.
    Essentially, keep things as simple as possible, and this will allow you to write cleaner code and also decide on the depth of the structure at runtime, like you describe.

  • What is hierarchical data transfer in functional location

    hai,
    i want to know indetail about hierarchical data transfer and horizontal data transfer in functional location.
    can any one help me in this regard....
    plz give information with some example if you dont mind...
    thanks in advance
    regards
    gunnu.

    Hi
    From SAP HELP
    Hierarchical Data Transfer
    Definition
    You can maintain data at a high level within a hierarchical object structure. The system will automatically transfer the data changes to the levels below that are affected.
    The maintenance planner group is changed for the clarification plant described in Functional Location. The employee responsible for maintaining the master data makes the change to the master record of the highest functional location C1 and saves the changes. The system automatically makes the same change for all affected functional locations below the functional location C1, and issues a message to inform the employee of these changes.
    Horizontal Data Transfer
    Definition
    With horizontal data transfer you can differentiate between:
    Data transfer from reference location to functional location
    Data transfer from functional location to installed piece of equipment
    The ABC indicator of the functional location C1-B02-1 "Ventilator" is to be changed for several clarification plants.
    The employee responsible for maintaining the master data makes the change in the master record of the reference functional location and saves the entries.
    The system automatically makes the same change for all affected functional locations that were assigned to this reference location and for the pieces of equipment that are installed at these locations. The system then issues a message informing the employee of the changes.
    Regards
    thyagarajan

  • How to model hierarchical data?

    I need a way to model hierarchical data. I have tried using an object so far, and it hasn't worked. Here is the code for the class I made: http://home.iprimus.com.au/deeps/StatsGroupClass.java. As you can see, there are 4 fields: 1 to store the name of the "group", 2 integer data fields, and 1 Vector field to store all descendants. Unfortunately, this this not seem to be working as the Vector get(int index) method returns an Object. This is the error I get:
    Test.java:23: cannot resolve symbol
    symbol  : method getGroupName  ()
    location: class java.lang.Object
          echo("Primary Structure with index 0: " + data.get(0).getGroupName());
                                                            ^
    1 error I figure I can't use the approach I have been using because of this.
    Can anyone help me out?

    Test.java:23: cannot resolve symbolsymbol  : method getGroupName  ()location: class java.lang.Object      echo("Primary Structure with index 0: " + data.get(0).getGroupName());                                                        ^1 errorYou need to cast the return value from get(0):
    ((YourFunkyClass)data.get(0)).getGroupName();Be aware that you're opening yourself up to the possibility of a runtime ClassCastException. You could consider using generics if you can guarantee that the data Vector will contain only instances of YouFunkyClass.
    Hope this helps

  • AdvancedDataGrid - create Array (cfquery) with children for hierarchical data set

    I'm trying to create an AdvancedDataGrid with a hierarchical
    data set as shown below. The problem that I am having is how to
    call the data from a ColdFusion remote call and not an
    ArrayCollection inside of the Flex app (as below). I'm guessing
    that the problem is with the CFC that I've created which builds an
    array with children. I assume that the structure of the children is
    the issue. Any thoughts?
    Flex App without Remoting:
    http://livedocs.adobe.com/labs/flex3/html/help.html?content=advdatagrid_10.html
    <?xml version="1.0"?>
    <!-- dpcontrols/adg/GroupADGChartRenderer.mxml -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    [Bindable]
    private var dpHierarchy:ArrayCollection= new
    ArrayCollection([
    {name:"Barbara Jennings", region: "Arizona", total:70,
    children:[
    {detail:[{amount:5}]}]},
    {name:"Dana Binn", region: "Arizona", total:130, children:[
    {detail:[{amount:15}]}]},
    {name:"Joe Smith", region: "California", total:229,
    children:[
    {detail:[{amount:26}]}]},
    {name:"Alice Treu", region: "California", total:230,
    children:[
    {detail:[{amount:159}]}
    ]]>
    </mx:Script>
    <mx:AdvancedDataGrid id="myADG"
    width="100%" height="100%"
    variableRowHeight="true">
    <mx:dataProvider>
    <mx:HierarchicalData source="{dpHierarchy}"/>
    </mx:dataProvider>
    <mx:columns>
    <mx:AdvancedDataGridColumn dataField="name"
    headerText="Name"/>
    <mx:AdvancedDataGridColumn dataField="total"
    headerText="Total"/>
    </mx:columns>
    <mx:rendererProviders>
    <mx:AdvancedDataGridRendererProvider
    dataField="detail"
    renderer="myComponents.ChartRenderer"
    columnIndex="0"
    columnSpan="0"/>
    </mx:rendererProviders>
    </mx:AdvancedDataGrid>
    </mx:Application>
    CFC - where I am trying to create an Array to send back to
    the Flex App
    <cfset aPackages = ArrayNew(1)>
    <cfset aDetails = ArrayNew(1)>
    <cfloop query="getPackages">
    <cfset i = getPackages.CurrentRow>
    <cfset aPackages
    = StructNew()>
    <cfset aPackages['name'] = name >
    <cfset aPackages
    ['region'] = region >
    <cfset aPackages['total'] = total >
    <cfset aDetails
    = StructNew()>
    <cfset aDetails['amount'] = amount >
    <cfset aPackages
    ['children'] = aDetails >
    </cfloop>
    <cfreturn aPackages>

    I had similar problems attempting to create an Array of
    Arrays in a CFC, so I created two differents scripts - one in CF
    and one in Flex - to build Hierarchical Data from a query result.
    The script in CF builds an Hierarchical XML document which is then
    easily accepted as HIerarchical Data in Flex. The script in Flex
    loops over the query Object that is returned as an Array
    Collection. It took me so long to create the XML script, and I now
    regret it, since it is not easy to maintain and keep dynamic.
    However, it only took me a short while to build this ActionScript
    logic, which I quite like now (though it is not [
    yet ] dynamic, and currently only handles two levels of
    Hierarchy):
    (this is the main part of my WebService result handler)....
    // Create a new Array Collection to store the Hierarchical
    Data from the WebService Result
    var categories:ArrayCollection = new ArrayCollection();
    // Create an Object variable to store the parent-level
    objects
    var category:Object;
    // Create an Object variable to store the child-level
    objects
    var subCategory:Object;
    // Loop through each Object in the WebService Result
    for each (var object:Object in results)
    // Create a new Array Collection as a copy of the Array
    Collection of Hierarchical Data
    var thisCategory:ArrayCollection = new
    ArrayCollection(categories.toArray());
    // Create a new instance of the Filter Function Class
    var filterFunction:FilterFunction = new FilterFunction();
    // Create Filter on the Array Collection to return only
    those records with the specified Category Name
    thisCategory.filterFunction =
    filterFunction.NameValueFilter("NAMETXT", object["CATNAMETXT"]);
    // Refresh the Array Collection to apply the Filter
    thisCategory.refresh();
    // If the Array Collection has records, the Category Name
    exists, so use the one Object in the Collection to add Children to
    if (thisCategory.length)
    category = thisCategory.getItemAt(0);
    // If the Array Collection has no records, the Category Name
    does not exist, so create a new Object
    else
    // Create a new parent-level Object
    category = new Object();
    // Create and set the Name property of the parent-level
    Object
    category["NAMETXT"] = object["CATNAMETXT"];
    // Create a Children property as a new Array
    category["children"] = new Array();
    // Add the parent-level Object to the Array Collection
    categories.addItem(category);
    // Create a new child-level Object as a copy of the Object
    in the WebService Result
    subCategory = object;
    // Create and set the Name property of the child-level
    Object
    subCategory["NAMETXT"] = object["SUBCATNAMETXT"];
    // Add the child-level Object to the Array of Children on
    the parent-level Object
    category["children"].push(subCategory);
    // Convert the Array Collection to a Hierarchical Data
    Object and use it as the Data Provider for the Advanced Data Grid
    advancedDataGrid.dataProvider = new
    HierarchicalData(categories);

  • Tree interface concept for hierarchical data creation/modification

    I am designing an interface for hierarchical data creation and maintenance. The interface will have to provide all basic data modifications options:
    edit an existing node, add new child/parent/sibling, as well as removing, sorting, dragging and dropping nodes around. Flex tree control is fully capable of all these functions while coding is not going to be a simple task. Has anyone worked on something like this? Any conceptual ideas?
    Thanks

    WOW Odie! You're awesome !! It worked like a charm, I created a view as you suggested:
    CREATE OR REPLACE FORCE VIEW "VIEW_TASKS_PROJECTS_TREE" ("ID", "PARENT_ID", "NODE_NAME") AS
    SELECT to_char(id) as id
    , null as parent_id
    , project_name as node_name
    FROM eba_task_projects
    UNION ALL
    SELECT to_char(id)
    , to_char(project_id)
    , task_name
    FROM eba_task_tasks;
    And then I created a new tree with the defaults and customized the Tree query a bit (just added the links really):
    select case when connect_by_isleaf = 1 then 0
    when level = 1 then 1
    else -1
    end as status,
    level,
    "NODE_NAME" as title,
    null as icon,
    "ID" as value,
    null as tooltip,
    'f?p=&APP_ID.:22:&SESSION.::NO::P22_ID,P22_PREV_PAGE:' || "ID" || ',3' as link
    from "#OWNER#"."VIEW_TASKS_PROJECTS_TREE"
    start with "PARENT_ID" is null
    connect by prior "ID" = "PARENT_ID"
    order siblings by "NODE_NAME"
    Thanks man, you saved me a lot of time and headaches :)

  • Hierarchical Data in Xcelsius (4 Levels)

    Hello ..
    is it possible to show hierarchical data for 4 Levels in Xcelsius.
    Example:
    first top-Down menu contains Countries. After selection of country the Diagramm should show Measures of the selected country
    second Top Down for Regions should show me dynamically only the Regions of the pre selected country
    Same thing with third Top Down for City and city Code ..
    Is it possible ..?

    Hello,
    filters are very restricted. The end result of filters has to be exactly 1 row to apply them.
    Category selectors offers more freedom but not enough to navigate trough 4 Hierarchies.
    It s normally not the purpose of excelsius to navigate trough information. But Customers usually don t make the difference between Reporting and Dashborads.

  • How to delete hierarchical data?

    Hello,
    I have a table with hierarchical data. I want to delete data based on a condition, but maybe this condition is only present in the topmost hierarchy.
    In my example I have rows identified by id and a changed_by containing the id of the row that replaced (invalidated) this row. From these I want to delete data where descr in the leaf nodes is 'A'.
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    DROP TABLE test_del;
    CREATE TABLE test_del (
         CONSTRAINT pk_del PRIMARY KEY (id)
        ,id         NUMBER
        ,changed_by NUMBER
         CONSTRAINT fk_del
         REFERENCES test_del (id)
        ,descr      VARCHAR2(10)
    INSERT INTO test_del (id,changed_by,descr)
    VALUES (3,NULL,'A');
    INSERT INTO test_del (id,changed_by,descr)
    VALUES (2,3,'A');
    INSERT INTO test_del (ID,changed_by,descr)
    VALUES (1,2,NULL);
    INSERT INTO test_del (id,changed_by,descr)
    VALUES (6,NULL,'A');
    INSERT INTO test_del (id,changed_by,descr)
    VALUES (5,6,'A');
    INSERT INTO test_del (id,changed_by,descr)
    VALUES (10,NULL,'B');
    INSERT INTO test_del (id,changed_by,descr)
    VALUES (9,10,'B');
    INSERT INTO test_del (id,changed_by,descr)
    VALUES (8,9,'B');
    COMMIT;
    SELECT  *
    FROM    test_del
    CONNECT BY PRIOR id = changed_by
    START WITH descr = 'A' AND changed_by IS NULL;
            ID CHANGED_BY DESCR
             3            A
             2          3 A
             1          2
             6            A
             5          6 A
    DELETE FROM test_del WHERE descr = 'A';
    ORA-02292: integrity constraint (FE.FK_DEL) violated - child record found
    Of course I get ORA-02292 in this case, but how can I write a correct statement that deletes the data shown by the select?
    Regards
    Marcus

    You need to follow the hierarchy:
    DELETE FROM test_del
          WHERE ROWID IN (
              SELECT ROWID
                FROM test_del
             CONNECT BY PRIOR id = changed_by
               START WITH descr = 'A'
                      AND changed_by IS NULL);

  • Converting a 2Dimensional Array(Hierarchical Data) into XML List/Xml/Xmlistcollection in Flex

    How to convert a flat/hierarchical data (which I get from Excel as 2D Array) to XML format in Flex. The following is my Hierarchical Data:(Table form)
    Asia
    India
    Chennai
    TN
    Category1
    Product1
    100
    Asia
    India
    Mumbai
    MH
    Category1
    Product1
    100
    Asia
    India
    Calcutta
    CT
    Category1
    Product1
    100
    Asia
    India
    Calcutta
    CT
    Category2
    Product2
    200
    EMEA
    UK
    London
    LN
    Category3
    Product1
    122
    EMEA
    UK
    London
    LN
    Category3
    Product2
    201
    EMEA
    UK
    Reading
    RN
    Category1
    Product1
    123
    EMEA
    UK
    Reading
    RN
    Category1
    Product2
    455
    I need to format/convert this to XML format so that I can populate that resulting xml as dataprovider to a Tree control.
    I need to populate the above data into Tree component such that I get the following output:
    Asia
             India
                   Chennai
                       TN
                           Category1
                                Product1
                                         100
        Mumbai
                        MH
                           Category1
                                 Product1
                                          100  
    .............goes on till last numerical data of above table

    Try this into json then to xml. I did similar one using PHP and JSON.

  • Hierarchical data structure

    I am trying to represent the following data structure in hierarchical format ---- but I am not going to use any swing components, so jtree and such are out, and xml is probably out. I was hoping some form of collection would work but I can't seem to get it!
    Example Scenario
    Football League --- Football Team -- Player Name
    West
    ------------------------------Chiefs
    -------------------------------------------------------------xyz
    -------------------------------------------------------------abc
    -------------------------------------------------------------mno
    ------------------------------Broncos
    ------------------------------------------------------------asq
    ------------------------------------------------------------daff
    This hierarchical structure has a couple of layers, so I don't know how I can feasibly do it. I have tried to look at making hashmaps on top of each other so that as I iterate thru the data, I can check for the existence of a key, and if it exists, get the key and add to it.
    Does anyone know a good way to do this? Code samples would be appreciated!!!
    Thank you!

    Hi Jason,
    I guess you wouldn't want to use Swing components or JTree unless your app has some GUI and even then you would want to look for some other structure than say JTree to represent your data.
    You have got plenty options one is that of using nested HashMaps. You could just as well use nested Lists or Arrays or custom objects that represent your data structure.
    I don't know why you should exclude XML. There is the question anyway how you get your data in your application. Is a database the source or a text file? Why not use XML since your data seems to have a tree structure anyway and XML seems to fit the bill.
    An issue to consider in that case is the amount of data. Large XML files have performance problems associated with them.
    In terms of a nice design I would probably do something like this (assuming the structure of your data is fixed):
    public class Leagues {
        private List leagues = new ArrayList();
        public FootballLeague getLeagueByIndex(int index) {
            return (FootballLeague)leagues.get(index);
        public FootballLeague getLeagueByName(String name) {
            // code that runs through the league list picking out the league with the given name
        public void addLeague(FootballLeague l) {
            leagues.add( l );
    }Next you define a class called FootballLeague:
    public class FootballLeague {
        private List teams = new ArrayList();
        private String leagueName;
        public FootballTeam getTeamByIndex(int index) {
            return (FootballTeam)teams.get( index );
        public FootballTeam getTeamByName(String name) {
            // code that runs through the team list picking out the team with the given name
        public void addTeam(FootballTeam t) {
            teams.add( t );
        public void setTeamName(String newName) {
            this.name = newName;
        public String getTeamName() {
            return this.name;
    }Obviously you will continue defining classes for Players next following that pattern. I usually apply that kind of structure for complex hierarchical data. Nested lists would be just as fine, but dealing with nested lists rather than a simple API for you data structures can be a pain (especially if you have many levels in your hierarchy);
    Hope that helps.
    The Dude

  • Hierarchical data maintainance

    Hello,
    I have a table (Parent - Child).
    There is a requirement to maintain this table, thats the hierarchy of the oraganisation.
    So, every quater they will be updating the table.
    They will be importing the data through an excel and in that excel there are 3 action items,
    => Insert, Update and Delete (logical delete).
    CREATE TABLE PARENT_CHILD_TBL
       ( "ID" VARCHAR2(6 BYTE) NOT NULL ENABLE,
    "ID_DESC" VARCHAR2(200 BYTE),
    "ID_LEVEL" VARCHAR2(200 BYTE),
    "PARENT_ID" VARCHAR2(200 BYTE)
    For Update:
    Any ideas, What all validation can come for an updation of an hierarchical data in general.
    Like
    = how to derive the level value at database side when the id is updated to some other level.
    = How to maintain the relation.
    A -> B -> D ( A is the grand parent here).
    A -> C
    eg: if B is updated as parent node of A, then we should throw error (cyclic data).
    Any more validations for hierarchical data, anybody can suggest and the way to go for it will be helpful.
    Thanks !!

    Hi,
    You can use the LEVEL psudo-column in a CONNECT BY query:
    SELECT  p.*
    ,       LEVEL
    ,       CASE
                WHEN  TO_CHAR (LEVEL, 'TM') = id_level
                THEN  'OK'
                ELSE  ' *** BAD ***'
    END     AS flag
    FROM    parent_child_tbl  p
    START WITH  parent_id  = '0000'
    CONNECT BY  parent_id  = PRIOR id
    Output from the sample data you posted (where all the level_ids are correct):
                              PARENT
    ID    ID_DESC    ID_LEVEL _ID            LEVEL FLAG
    A     ROOT       1        0000               1 OK
    B     CHILD1     2        A                  2 OK
    D     SUB CHILD1 3        B                  3 OK
    C     CHILD2     2        A                  2 OK
    If you only want to see the rows where id_level is wrong, then you can use LEVEL in a WHERE clause.
    Maybe you shouldn't bother manually entering id_level at all, and just have a MERGE statement populate that column after all the other data is entered.
    Why is the id_level column defined as a VARCHAR2, rather than a NUMBER?
    Given that it must be a VARCHAR2, why does it need to be 200 bytles long?

  • Hierarchical data in VizPacker

    Hi,
    I am creating an extension of tree layout for lumira. I have implemented d3 part of it, but i am facing issue while using same in vizpacker. I am uploading data from csv file. Inside my d3 code i am recieving csv data as array of json objects, i am using d3.nest() to create hierarchical data and this way i am able to draw my graph but with vizpacker, format of data is different.
    [{"Set 1":["Population over 60","India","2002"],"NumericMeasure":["7.01"]},{"Set 1":["Population under 15","India","2002"],"NumericMeasure":["33.42"]},{"Set 1":["Population over 60","India","2003"],"NumericMeasure":["7.08"]},{"Set 1":["Population under 15","India","2003"],"NumericMeasure":["33.03"]},{"Set 1":["Population over 60","India","2004"],"NumericMeasure":["7.15"]},{"Set 1":["Population under 15","India","2004"],"NumericMeasure":["32.62"]}]
    I want to nest elements first by country and then by Indicators followed by NumericMeasure like this
    {"country": "India","children": [{"Indicator": "population under 15","children": [{"year": "2002","numericMeasure": "30.1"},{"year": "2003","numericMeasure": "31.5"},{
    "year": 2004,"numericMeasure": "32.9"}]},{"Indicator": "population over 60","children": [{"year": "2002","numericMeasure": "7.1"},{"year": "2003","numericMeasure": "7.5"},{"year": 2004,"numericMeasure": "7.0"
    How should i do it? Thanks in advance!
    Regards,
    Ashish.

    Hey Ashish,
    I'm currently in an [R] headspace, so coming back to JS/VizPacker may require some additional time to go through your code with you.
    As an employee I would highly recommend that you revert internally, as there are some great resources for you (be sure to check out the JAM page; Jan should be able to guide you) - and then you can come back and post the solution to your question.
    This example in d3 is pretty straight-forward though:
    var data = [
      { "name" : "Level 2: A", "parent":"Top Level" },
      { "name" : "Top Level", "parent":"null" },
      { "name" : "Son of A", "parent":"Level 2: A" },
      { "name" : "Daughter of A", "parent":"Level 2: A" },
      { "name" : "Level 2: B", "parent":"Top Level" }
    // *********** Convert flat data into a nice tree ***************
    // create a name: node map
    var dataMap = data.reduce(function(map, node) {
    map[node.name] = node;
    return map;
    // create the tree array
    var treeData = [];
    data.forEach(function(node) {
    // add to parent
    var parent = dataMap[node.parent];
    if (parent) {
    // create child array if it doesn't exist
    (parent.children || (parent.children = []))
    // add node to child array
    .push(node);
    } else {
    // parent is null or missing
    treeData.push(node);
    // ************** Generate the tree diagram *****************
    var margin = {top: 20, right: 120, bottom: 20, left: 120},
    width = 960 - margin.right - margin.left,
    height = 500 - margin.top - margin.bottom;
    var i = 0;
    var tree = d3.layout.tree()
    .size([height, width]);
    var diagonal = d3.svg.diagonal()
    .projection(function(d) { return [d.y, d.x]; });
    var svg = d3.select("body").append("svg")
    .attr("width", width + margin.right + margin.left)
    .attr("height", height + margin.top + margin.bottom)
      .append("g")
    .attr("transform", "translate(" + margin.left + "," + margin.top + ")");
    root = treeData[0];
    update(root);
    function update(source) {
      // Compute the new tree layout.
      var nodes = tree.nodes(root).reverse(),
    links = tree.links(nodes);
      // Normalize for fixed-depth.
      nodes.forEach(function(d) { d.y = d.depth * 180; });
      // Declare the nodes…
      var node = svg.selectAll("g.node")
    .data(nodes, function(d) { return d.id || (d.id = ++i); });
      // Enter the nodes.
      var nodeEnter = node.enter().append("g")
    .attr("class", "node")
    .attr("transform", function(d) {
      return "translate(" + d.y + "," + d.x + ")"; });
      nodeEnter.append("circle")
    .attr("r", 10)
    .style("fill", "#fff");
      nodeEnter.append("text")
    .attr("x", function(d) {
      return d.children || d._children ? -13 : 13; })
    .attr("dy", ".35em")
    .attr("text-anchor", function(d) {
      return d.children || d._children ? "end" : "start"; })
    .text(function(d) { return d.name; })
    .style("fill-opacity", 1);
      // Declare the links…
      var link = svg.selectAll("path.link")
    .data(links, function(d) { return d.target.id; });
      // Enter the links.
      link.enter().insert("path", "g")
    .attr("class", "link")
    .attr("d", diagonal);
    (see the full example here: D3.js tree diagram generated from 'flat' data)
    If you haven't done so already, I would highly recommend you go through Matt Lloyd's tutorials for the VizPacker (Part 1, Part 2, Part 3).
    What is the d3 example that you are looking at?
    Can you confirm that your method works externally in HTML - and that you're not getting your intended output from the Lumira side, please?
    //bijan

  • Convert Non-Hierarchical data into Hierarchical data for Tree creation

    Hi guys,
    I've been trying to figure this out for about two entire days now and I'm still stuck and see no possible solution which doesn't involve a new table creation.
    Thing is that I want to create a Tree to navigate through Projects and Tasks, I'm using the "Task Manager" demo app, which I have customized a bit to fit my needs.
    Basically I cannot create the Tree 'cause the relation between Projects and Tasks is not a hierarchical relation, it's a 1:N relation as this:
    __Projects__
    ID (PK)
    PROJECT_NAME
    ___Tasks___
    ID (PK)
    PROJECT_ID (FK references Projects.ID)
    So what I need to do is "force" that 1:N relation to a a hierarchical relation by creating a query (view) that joins the two tables into a single one and that have 2 columns I can use as ID and PARENT_ID for the tree creation.
    This is the Data Model:
    CREATE TABLE "EBA_TASK_PROJECTS"
    (     "ID" NUMBER,
         "PROJECT_NAME" VARCHAR2(255),
         "CREATED_ON" DATE NOT NULL ENABLE,
         "CREATED_BY" VARCHAR2(255) NOT NULL ENABLE,
         "UPDATED_ON" DATE,
         "UPDATED_BY" VARCHAR2(255),
         "FLEX_01" VARCHAR2(4000),
         "FLEX_02" VARCHAR2(4000),
         "FLEX_03" VARCHAR2(4000),
         "FLEX_04" VARCHAR2(4000),
         "FLEX_05" VARCHAR2(4000),
         "PARENT_ID" NUMBER,
         "IS_ACTIVE" VARCHAR2(1),
         "DESCRIPTION" VARCHAR2(4000),
         CONSTRAINT "EBA_TASK_PROJECTS_ACTIVE_CC" CHECK (is_active in ('Y', 'N')) ENABLE,
         CONSTRAINT "EBA_TASK_PROJECTS_PK" PRIMARY KEY ("ID") ENABLE
    ) ;ALTER TABLE "EBA_TASK_PROJECTS" ADD CONSTRAINT "EBA_TASK_PROJECTS_FK" FOREIGN KEY ("PARENT_ID")
         REFERENCES "EBA_TASK_PROJECTS" ("ID") ON DELETE CASCADE ENABLE;
    CREATE TABLE "EBA_TASK_TASKS"
    (     "ID" NUMBER NOT NULL ENABLE,
         "PROJECT_ID" NUMBER NOT NULL ENABLE,
         "TASK_PRIORITY" VARCHAR2(400) NOT NULL ENABLE,
         "TASK_DIFFICULTY" VARCHAR2(400) NOT NULL ENABLE,
         "TASK_NAME" VARCHAR2(4000) NOT NULL ENABLE,
         "TASK_DETAILS" VARCHAR2(4000),
         "CREATED_ON" DATE NOT NULL ENABLE,
         "COMPLETED" DATE,
         "CREATED_BY" VARCHAR2(400) NOT NULL ENABLE,
         "STATUS" VARCHAR2(4000),
         "UPDATED_ON" DATE,
         "STARTED" DATE,
         "TASK_PREDEFINED_ID" NUMBER,
         "UPDATED_BY" VARCHAR2(255),
         "USER_NAME" VARCHAR2(255) NOT NULL ENABLE,
         "FLEX_01" VARCHAR2(4000),
         "FLEX_02" VARCHAR2(4000),
         "FLEX_03" VARCHAR2(4000),
         "FLEX_04" VARCHAR2(4000),
         "FLEX_05" VARCHAR2(4000),
         "PERCENTAGE" NUMBER,
         CONSTRAINT "EBA_TASK_TASKS_PK" PRIMARY KEY ("ID") ENABLE
    ) ;ALTER TABLE "EBA_TASK_TASKS" ADD CONSTRAINT "EBA_TASK_TASKS_PROJECTS_FK" FOREIGN KEY ("PROJECT_ID")
         REFERENCES "EBA_TASK_PROJECTS" ("ID") ON DELETE CASCADE ENABLE;
    I'm using APEX4.0
    That's pretty much it guys, hope you can help me with this. I'm really stuck on this and am about to give up.

    WOW Odie! You're awesome !! It worked like a charm, I created a view as you suggested:
    CREATE OR REPLACE FORCE VIEW "VIEW_TASKS_PROJECTS_TREE" ("ID", "PARENT_ID", "NODE_NAME") AS
    SELECT to_char(id) as id
    , null as parent_id
    , project_name as node_name
    FROM eba_task_projects
    UNION ALL
    SELECT to_char(id)
    , to_char(project_id)
    , task_name
    FROM eba_task_tasks;
    And then I created a new tree with the defaults and customized the Tree query a bit (just added the links really):
    select case when connect_by_isleaf = 1 then 0
    when level = 1 then 1
    else -1
    end as status,
    level,
    "NODE_NAME" as title,
    null as icon,
    "ID" as value,
    null as tooltip,
    'f?p=&APP_ID.:22:&SESSION.::NO::P22_ID,P22_PREV_PAGE:' || "ID" || ',3' as link
    from "#OWNER#"."VIEW_TASKS_PROJECTS_TREE"
    start with "PARENT_ID" is null
    connect by prior "ID" = "PARENT_ID"
    order siblings by "NODE_NAME"
    Thanks man, you saved me a lot of time and headaches :)

  • Creating custom hierarchical data provider

    Hi,
    I'm trying to create a custom dataprovider for a 3rd party
    chart control. As far as I can tell, it works just like any
    Flex-provided hierarchical dataprovider control. My problem doesn't
    have to do with the control directly, as I haven't yet even tried
    to interface my dataprovider with their control (that's why I'm
    posting here). I'm having a lot of troubling figuring out how to
    implement IHierarchicalData and IHierarchicalCollectionView (or
    figuring out what to extend and override to give me the
    functionality). The documentation doesn't seem to be detailed
    enough to help me .
    I can't use a normal XML dataprovider because the XML I have
    contains child elements that are data, so I can't just use the
    hierarchy of the XML itself. I need to process the XML in some way
    using code that actually understands its structure. I intend to
    process this into a class that implements IHierarchicalData. The
    documentation is really vague on what the results of a call to
    getChildren() returns (and how the calling code then breaks the
    children apart so it can call getData() on each), but I was able to
    figure that out by looking at the source for the chart control I'm
    using (it appears to expect an ArrayCollection... why isn't the
    IHierarchicalData interface typed as such?). My biggest problem is
    understanding the IHierarchicalCollectionView. It has methods to
    add and remove child nodes, but I don't see how it's possible for
    it to do that. It only has a reference to an IHierarchicalData,
    which provides no methods to perform those operations. When I wrap
    my IHierarchicalData in the default HierarchicalCollectionView
    object (which is just what the chart does, as far as I can tell)
    and use methods like addChild(), I get a null reference error, as
    mentioned in this stack trace snippet:
    Error #1009: Cannot access a property or method of a null
    object reference.
    at mx.collections::HierarchicalCollectionView/addChild()
    I believe I need the HierarchicalCollectionView (or to extend
    a class that implements the IHierarchicalCollectionView interface
    or implement it myself) because I need to use its functions to
    modify my tree structure so that when I change the data, the chart
    will update. Is this a correct assumption? If so, how do I use
    those functions on the HierarhicalCollectionView? What is it doing
    internally? I don't understand how it can be manipulating the tree
    in a type-safe manner having only an IHierarchicalData reference to
    work with, and if it's doing it in a non-typesafe manner, I need to
    know what methods it's calling on my tree or node objects, which
    don't appear to be documented in the docs for
    IHierarchicalCollectionView.
    If I'm totally off-base in the best way to accomplish my
    goal, please let me know. I'd also appreciate any information you
    could give me, such as info on the hierarchy interfaces that goes
    beyond the docs. Some source code for HierarchicalCollectionView
    would be super helpful (only for reverse engineering; it should
    really be documented somewhere), but I haven't been able to find
    any. Isn't it open source?
    Thank you very much for any help you can provide.

    SAP Note 746227 has addressed this issue. I will close this question.

  • Posting hierarchical data

    Hi,
    Can any body give me give suggestions of how I can implement the Hierarchical posting of data into database.
    For ex. I have a XML document which contains records for Dept. and Emp tables. I want to post these datagrams into respective tables.
    <ROWSET>
    <ROW>
    <DEPTNO>10</DEPTNO>
    <LOC>New York</LOC>
    <NAME>Accounting</NAME>
    <tname>DEPT</tname>
    </ROW>
    <ROW>
    <EMPNO>3456</EMPNO>
    <ENAME>SMITH</ENAME>
    <MGR>5677</MGR>
    <tname>EMP</tname>
    </ROW>
    </ROWSET>
    here tname identifies the table into which data will go and we don't which tables info. the xml document will have and the relation ship between those tables.
    I am looking for more generalized mechanism to hadle this. I mean the xml document may contain more than two tables info. and may contain in random order.
    Note:
    I think if we get the hierarchy from all_constraints view we could solve the problem.
    Thanks in adv.
    Hari.

    For a totally generic solution that's driven off information in ALL_TABLES, ALL_TAB_COLUMNS, and ALL_CONS_COLUMNS, and ALL_CONSTRAINTS, you'd need to author it yourself unfortunately.
    If you're doing it in PL/SQL, you might find some useful constraint-walking code in the DBXML package that is part of our sample code we put on the web a long time ago called the "PLSXML Examples and Utilities".
    Specifically, the DBXML.SQL package has some generic procedures for retrieving the inbound and outbound constraints on a table.
    http://technet.oracle.com/tech/xml/info/index2.htm?Info&plsxml/xml4plsql.htm

Maybe you are looking for

  • HT4623 How do I get the calendar to show the whole month and not just the day or week.

    How do I get the calendar on my updated i phone 7 to show the whole month and not just the week or the day?

  • Syncing Podcasts after OS 3

    After upgrading to OS 3 certain old podcasts which were long deleted and which I can not find in my library reappeared on the phone. I can not figure out how to delete them. Syncing certainly isn't working Any ideas?

  • Disk/Permissions Repaired, User Info/Data Lost

    This is my first mac, switched from windows a few months back. Today my machine crashed severely (while working in ical), so I did a hard reboot. When the machine came back on, there was an icon in the middle of the screen alternating btw a ? and a f

  • Need Help on  Buying Book for PSE 7

    I bought Photoshop Elements 7 several months ago. I am not that savy with the program and was looking to buy a book to help me learn it. I've tried the on-line tutorials but didn't like them. I thought about  "PSE 7 Ultimate Guide for Dummies", but t

  • Telnet Service of J2EE Engine

    Hi All, Can Anyone Tell me the Breif Description About Telnet Service of J2EE Engine. Regards Nandha.