Questions tagged [hierarchical-data]

Hierarchical data reflects a set of parent-child relationships. These can be found in a genealogy, a taxonomy, a list of requirements for parts assembly, and innumerably other instances. Methods for dealing with hierarchical data are often essential for data management and analysis.

512 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
31votes
3answers
3kviews

Oracle SYS_CONNECT_BY_PATH equivalent query into SQL Server

I'm trying to convert a complex query involving the Oracle SYS_CONNECT_BY_PATH syntax into SQL Server: SELECT DISTINCT TO_CHAR(CONCAT(@ROOT, SYS_CONNECT_BY_PATH(CONCAT('C_',X), '.'))) ...
user avatar
  • 1,347
9votes
1answer
2kviews

What are the differences in these SQL closure table examples?

I am having some difficulty wrapping my mind around SQL closure tables, and would like some assistance in understanding some of the examples I have found. Lets say I have a table called sample_items ...
user avatar
6votes
0answers
10kviews

Multi-dimensional Dictionary class in VBA

This post is half to share a solution and half to ask if there's a better way to do it. Problem: how to build a multi-dimensional dictionary in VBA. It seems there are people out there looking for ...
user avatar
5votes
0answers
1kviews

hierarchical drop-down list in R shiny

We need to create a hierarchical drop-down list in R shiny. The list will have at least 3 levels. Could you please help me in identifying the correct library for this? Please refer the below pic for ...
user avatar
5votes
1answer
547views

Paginating hierarchical data using closure tables (MySQL)

I am trying to query paged hierarchical comments sorted by score. score is an integer, and the comments table has a self-referential parent_id column. Each page should have at least one root comment ...
user avatar
  • 81
5votes
0answers
7kviews

Infragistics WebHierarchicalDataGrid - Custom style on child bands when Databind to IList?

I'm trying to setup some custom styles and TemplateDataFields on the child band level of the Infragistics Hierarchical DataGrid. I'm binding the control to an IList which has sub lists. The control ...
user avatar
4votes
0answers
360views

graph databases for store nested comments

I'm designing a data model for a nested comment system. like Reddit. I read so many blogs throughout the internet, all the solution I found is trying to build a hierarchical data structure in ...
user avatar
4votes
0answers
226views

How to create a reorderable sibling relation in SQL? (order comments in a thread, songs in a playlist, etc)

I have a system that requires data models which are 'siblings', all part of the same collection that users should be able to reorder. Some concrete examples would be: A playlist containing many songs,...
user avatar
  • 4,628
3votes
0answers
96views

Possible to address nodes with Xpath in a 2-dimensional hierarchy?

Let's take the Excel Pivot data structure (or concept), where we have a hierarchy on the Rows (x-) and on the Cols (y-axis). Would it be possible (or have any attempts been made) to address location ...
user avatar
3votes
0answers
800views

Working with a dynamic hierarchy SQL Server

I have the following datasets in SQL Server Hierarchy Table: Report | Immediate Parent Child1 Parent1 Child2 Parent1 Child3 Parent2 Parent1 Grandparent1 Parent2 ...
user avatar
3votes
0answers
181views

WINBUGS : adding time and product fixed effects in a hierarchical data

I am working on a Hierarchical panel data using WinBugs. Assuming a data on school performance - logs with independent variable logp & rank. All schools are divided into three categories (cat) and ...
user avatar
  • 41
3votes
1answer
338views

Sorting siblings in nested set

I have a nested set model in SQLite database. The siblings need to be sorted alphabetically. Below is the full set, but the siblings that need to be sorted is the second level. As you can see, they ...
user avatar
  • 1,215
3votes
2answers
770views

How to visualize only the descendants, ancestors, and self of a node in a hierarchy?

In another question I asked about visualizing hierarchical data stored in a table in an SQL Server database. I found a way to visualize the whole hierarchy using GraphViz, with some plumbing in T-SQL ...
user avatar
3votes
1answer
947views

How to represent hierarchical structure in IndexedDB?

I have a complex and variable hierarchical data structure that I will be storing locally from JavaScript. Based on my research thus far it looks like IndexedDB is my best choice for a solution. My ...
user avatar
  • 887
2votes
0answers
62views

R: lm and lmer produce the same results

I recently conducted a study in which I divided participants into two conditions. They rated different items. I wanted to test whether their ratings differed between the two conditions. Because these ...
user avatar
  • 21
2votes
0answers
85views

Pandas melt single column level

I need to melt the top column level [6,3,4] of the following dataframe while preserving the value columns [a,b,c] and the sorting of the id columns [index,key]. In other words, as with melt, the ...
user avatar
  • 1,589
2votes
1answer
112views

Hierarchical rollup of sales data based on parent - child relationship, in Pandas

I have a Dataframe that has sales data by each sales person as shown below: employee, product, quantity emp_1, prod_a, 100 emp_1, prod_b, 200 emp_2, prod_a, 30 emp_4, prod_c, 400 emp_4, prod_a, ...
user avatar
  • 1,187
2votes
1answer
273views

Oracle hierarchical query in a view, bind «start with» arguments to query

I have a table with the columns parent_key1, parent_key2, child_key1, child_key2 definig trees through the connection of two pairs of parameters. The table is quite large, and it contains thousands of ...
user avatar
  • 119
2votes
2answers
200views

MySql Loan table, for each borrower find the root lender

I have a Mysql table as shown below: BORROWER Lender 1 2 2 3 3 4 4 NULL 5 NULL 6 7 7 5 I want to get the ...
user avatar
  • 599
2votes
0answers
66views

issue with hierarchical database structure

I am trying to make the hierarchical database structure but I am stuck with this I want to make a database for like below image details. this is the only an example and I have a project exactly like ...
user avatar
  • 629
2votes
1answer
293views

How to cycle a Pandas dataframe grouping by hierarchical multiindex from top to bottom and store results

I'm trying to create a forecasting process using hierarchical time series. My problem is that I can't find a way to create a for loop that hierarchically extracts daily time series from a pandas ...
user avatar
2votes
1answer
48views

Count people in companies in tree structure

Hello I have a structure table with companies_id(PK) and parent_companies_id(FK) column and people table with companies_id (FK) and people_id(PK). Some people can be in different companies. I want to ...
user avatar
  • 693
2votes
1answer
192views

Unable to run Poincare Embeddings example to get hierarchical representation

I'm trying to replicate Poincaré Embeddings for Learning Hierarchical Representations present on Github by Facebook Research. But I'm unable to run example.sh to embed the mammals subtree in the ...
user avatar
  • 1,128
2votes
0answers
181views

hts accuracy of forecast and method of splitting training and testing

I find 2 ways of training and testing hts and I am not sure which one is appropriate 1. In this question (link given) MASE Extraction Hierarchical Data ('hts' and 'forecast' packages R)...
user avatar
2votes
0answers
138views

Generate WORKFLOW in plSQL

i try to generate a workflow with recusive functions in plSQL but i don't get what i want. i got this table TABLETEST : GROUPE STATUS STATUSNEW A A1 A2 A A1 A3 A ...
user avatar
2votes
0answers
2kviews

d3 based multiple sub groups of a bar chart

I am trying to produce a bar graph that has multiple hierarchical / groupings of factors using d3.js. An example from excel of what I am attempting to create, subgrouped by Variety and Irrigation ...
user avatar
  • 16k
2votes
1answer
302views

Pandas: Cannot assign NaN using a boolean mask on MultiIndex columns

First, create this DataFrame: df = pd.DataFrame([[1,-2,3],[4,5,-6],[-7,8,9]], columns=pd.MultiIndex.from_tuples( [('foo', 'bar'), ('foo', 'baz'), ('ignore', 'other')])) That is: foo ...
user avatar
2votes
1answer
516views

MySQL / PHP - Multi tier category structure

I'm building a website that contains a product database. Each product belongs to a category. The structure of categories is multi-tiered and can contain any number of tiers, for example: Electronics >...
user avatar
  • 4,952
2votes
2answers
100views

Store a tree in a database

I'm currently trying to figure out the best way to store a tree in a database (mysql probably if it is possible). These are the constraints and the use of the tree : Each nodes can have 4 children ...
user avatar
2votes
0answers
800views

Hierarchical Data in multiple tables

Okay, this is my first try after reading for hours and hours. I got a hierarchical data-structure and found this topic HAS BEEN ASKED before and also many people found solutions for their problems. ...
user avatar
  • 21
2votes
0answers
1kviews

WPF DataGrid with multiple columns in group row

I am trying to work with native WPF DataGrid control to show hierarchical data. Similar to the structure of data shown in image below (ignore the cosmetics) where : GroupRows have same number of ...
user avatar
  • 3,283
2votes
1answer
123views

Javascript - optimizing node hierarchy updates for 3D animations

I am using WebGL to do hardware skinning, however updating my model node hierarchies is causing a huge hit for performance. Every node needs to query its current location/rotation/scale keyframes, ...
user avatar
2votes
1answer
1kviews

SQL Hierarchical query - Multiple layers, only care about one

I have a table that lists job and work order information. Every job has at least one work order, most jobs have many work orders. Some work orders can have sub-work orders and subs can have subs as ...
user avatar
  • 33
2votes
1answer
305views

Guidance with SQL SYS_CONNECT_BY_PATH

Hello new to the boards and been browsing for similar topics but haven't been able to fine a query that works for my use case, if someone here can please help me out I would greatly appreciate it! I '...
user avatar
  • 21
2votes
0answers
815views

R simulate binomial multilevel data to estimate power for various ICCs

In advance I'd like to apologize for the length of this post :S [EDITS BELOW] I would like to do a sample size calculation for a cluster randomized trial with a binary outcome. Outcome is whether ...
user avatar
  • 21
2votes
1answer
2kviews

How to import csv data with parent/child (category-subcategory) hierarchy to MySQL using Python

I am importing a csv file containing a parent/child (category-subcategory) hierarchy to MySQL, using Python's MySQLdb module. Here is an example csv file: vendor,category,subcategory,product_name,...
user avatar
2votes
0answers
384views

Bind to HierarchicalDataTemplate DataContext from nested DataTemplate

I have my treeview with 2 level nested levels. <TreeView ItemsSource="{Binding Project.Tables}"> <TreeView.Resources> <HierarchicalDataTemplate DataType="{x:Type TableModel}...
user avatar
  • 960
2votes
0answers
784views

Hierarchical query without a start with clause

I am working on a db schema with hierarchical data. Lets say the schema is like the following - ID1 parent_ID1 ID2 ID3 where ID1 parent_ID1 have the hierarchy information. The table is ...
user avatar
2votes
0answers
172views

Sorting siblings in a hierarchy of objects

I've implemented a scene tree to be used in a 2D game. The tree nodes contain transformations and drawable objects. This is what the scene tree looks like: Root ...
user avatar
2votes
1answer
1kviews

Counting products associated with hierarchical category listing

What I have: A table of categories listed Hierarchically: A table of products. the column category_id refers to category.id: What I am trying to do: I am trying to design a query that will count ...
user avatar
2votes
1answer
2kviews

Oracle: convert tree structure to XML

I have a simple tree structure, where child elements are connected to parent elements, that I need to convert to XML. Currently, I use recursive function calls to implement this (i.e. to retrieve the ...
user avatar
2votes
1answer
459views

Hierarchical tree in SQL database - different database server types

I have to store a hierarchical tree into a SQL database. After a search here on the site I found a couple solutions, but I still need some help. In short, I have “inputs” that must be routed to ...
user avatar
  • 21
2votes
1answer
653views

Mysql/PHP - account chart - summarization in the parent account

I'm facing some troubles trying to solve this. I have an account chart and I want to summarize the money column. My table 'category' has an auto relathionsip: category_table - id - parent_id - ...
user avatar
2votes
1answer
107views

Relational Mapping of finite tree with instances

I have to represent the following structure in a relational database. There are five hierarchy levels: A, B, C, D. The relation between the hierarchy levels is always one to many, so A has many B, but ...
user avatar
  • 918
2votes
0answers
204views

hierarchal data paging in mvc3

I've data in hierarchal format which can be nested up to an unkown level (imagine threaded comments or products with nested categories). This data is currently displayed in a tree like format using ...
user avatar
  • 2,037
2votes
1answer
121views

Create an infinite URL without MVC?

How can I create an infinite URL from some data hierarchy, using URL routing but without MVC? For instance, an example data hierarchy might be: Electronic Television Sound Systems Computer Scaner ...
user avatar
2votes
1answer
1kviews

Getting hierarchical data from self referencing table in SQL 2005

I am using SQL 2005, with existing data of millions of records (so data structure can not be changed) and I'm trying to do the following: I have some data (following example is from another question ...
user avatar
  • 8,437
2votes
0answers
958views

Binding Listview to multiple Object datasources ASP.net 3.5

I am using Object as the data source to my Listview and trying to display data in a Hierarchical manner. I am not able to figure out how to bind these objects to my listviews. Below pasted is the ...
user avatar
  • 9,931
1vote
0answers
20views

Oracle Hierarchical Query ( START WITH, CONNECT BY PRIOR ) using JPA native query: ORA-00933 SQL command not properly ended

Spring boot - Oracle 19 - JPA I've defined a simple hierarchical table, with a parent/child relationship. I have the following query: SELECT tnv.* FROM TBL_NOM_VERSION tnv WHERE tnv....
user avatar
  • 11
1vote
0answers
72views

Cluster robust standard errors for mixed effect/LMER models?

I'm estimating a mixed effects model using simulated data. The basis of this is a conjoint experiment: there are N number of countries in the study with P participants and each respondent is shown the ...
user avatar
  • 77

15 30 50 per page
1
2 3 4 5
11