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.

Hierarchical data reflects a set of parent-child relationships. As Materials Resource Planning was developed by manufacturers in the 1950s, hierarchical data management emerged as a theoretical and practical discipline. A manufacturer uses the term Bill of Materials (BOM) for the set of items required to assemble a parent item; the term BOM was adopted by mathematicians and software developers, and it is used today in both realms.

Hierarchical data is ubiquitous and has called forth some of the most important and complex work of database management. It has also propelled object-oriented programming.

The key design element is recursion. Imagine starting at the trunk of a tree and visiting every leaf; this theoretical exercise would require an enormously large number of decision points occurring in a nested or recursive pattern. Requirements for this analysis are remarkably varied and have produced entire sub-disciplines of database design.

2030 questions
0
votes
0 answers

Python: Infer item hierachy from branches

Description We downloaded a dataset for our research which contains hierarchical data. However the makers weren't consistent at all. For example sometimes we have something like: term1:term2:term3:term4 wehereas in other cases we only…
CodeNoob
  • 1,988
  • 1
  • 11
  • 33
0
votes
0 answers

How to index documents in elasticsearch in an hierarchical way?

I have some text documents which contain paragraphs, sections, etc and I know/can extract the name of the paragraphs and the content itself. I would like to index the content of the documents in elasticsearch but in a hierarchical mode. There is…
SimLine
  • 11
  • 8
0
votes
1 answer

SQL subquery with CTE

I have a hierarchical query with Common Table Expressions: WITH Revision(REV, MonitoringGroupId, BusinessLineId, REVTYPE, REVEND) AS ( SELECT REV, MonitoringGroupId, BusinessLineId, REVTYPE, REVEND FROM MonitoringGroupBusinessLine_AUD …
koryakinp
  • 3,989
  • 6
  • 26
  • 56
0
votes
1 answer

Child ID Parent ID concept

The source tables are TABLE 1 ID NAME X1 ssnnmm TABLE 2 ID NAME LEVEL Z1 ss 1 Z2 nn 2 Z3 mm 3 I want the result as below RESULT CHILD_ID PARENT_ID X1 Z1 Z1 Z2 Z2 Z3…
E.Manju
  • 19
  • 6
0
votes
4 answers

Recommendations for implementing a complex schema in SQL Server using XML Type

My application has a complex schema for the domain entity. It is required use SQL Server 2008. Following are the complexities: Domain Entity is Hierarchical: The data structure is a tree; it is nested to many levels. Few nodes in the tree are…
Kabeer
  • 4,138
  • 7
  • 40
  • 62
0
votes
1 answer

Parent child relation hierarchy (multiple children) - SQL Server

I have a table with multiple child-parent relations. I want to get a hierarchical data set. Table structure. (includes circular reference) Parent Child1 Child2 --====== ======== ======== 0 1000 NULL 1000 1001 NULL 1001 1002 …
Sandipan
  • 27
  • 8
0
votes
2 answers

C# IComparer with respect of the hierarchy

I implement IComparable / IComparer for custom sorting but I need to keep some hierarchy. My class : public class Attribut : IComparable { public int ATT_ID { get; set; } public string ATT_LIBELLE { get; set; } …
WDKyle
  • 85
  • 1
  • 6
0
votes
1 answer

Get Hierarchy data until last child - SQL Server

I have this table structure. I want to create a query for hierarchical data till last child only, no reference to parent again. Table structure : ParentId ChildId ------------------- NULL 6000101 6000101 6000102 …
Sandipan
  • 27
  • 8
0
votes
1 answer

SSAS display 1 value based on the time hierarchy and currency

SSAS, I have DAILY, MTD and YTD average balances in three currencies as measures and I want to display only 1 field when I filter by currency or choose month or year level from the hiearchy. thank you in advance
hadi
  • 1
0
votes
1 answer

Subtotal levels for ROLLUP on four columns in Oracle SQL

I'm trying to construct an Oracle SQL query using the ROLLUP operator. The query needs to summarize sales by year, quarter, store state, and store city over two years, with the result including subtotals for the two hierarchical dimensions of…
0
votes
2 answers

Hierarchical Data List Data Wrangling in R or Python

I have some data that was given to me in a format that I'm trying to get into a flat file for a customer. It is hierarchical data but it doesn't have all the data filled in and you can't just do an easy fill because of so many different sub levels…
rgh_dsa
  • 107
  • 8
0
votes
2 answers

How can I get all the parent element by providing child element ID in oracle?

My Oracle table looks like this ID | ParentID ----------------- 1 | 0 2 | 1 3 | 2 4 | 3 5 | 3 If I know only ID and need to get all parent elements in oracle, what…
user6631188
0
votes
2 answers

Get JSON value from second level in array's hierarchy using PHP

I have the following JSON: { "stars":5, "numberOfReviews":{ "total":1179, } } and the following PHP: $json = file_get_contents('url-of-json'); $obj = json_decode($json); print $obj->stars; This prints 5 as expected. How do I print the…
NuclearApe
  • 573
  • 2
  • 6
  • 16
0
votes
1 answer

Identify root node with group by

I need to identify the primary channel (which is highest in hierarchy) with only one set of flag set under it's hierarchy. In below case, US is not a valid primary channel since there are two flags underneath. Only valid primary channels are US1,…
Vishal
  • 198
  • 1
  • 3
  • 11
0
votes
1 answer

Sorting Closure Table Hierarchical Data Structure

You can think this question as follow-up for that one: Sorting a subtree in a closure table hierarchical-data structure Let's consider the modified example (with a new row called rating in category table): -- -- Table `category` -- CREATE TABLE IF…
oezby
  • 15
  • 3