2,094 questions
1
vote
1
answer
103
views
Build the JSON Hierarchy structure using raw response
I am struggling to build the JSON hierarchy structure from the raw response JSON which I am getting from other API.
I want to generate a hierarchy structure from raw JSON Response on the basis of ...
0
votes
0
answers
51
views
Hierarchy Transformation/Looping using Pyspark, Python
I have some SAS code and need to convert it to PySpark code.
Hierarchical SAS Code Part (1)
if cc1 = 1 then do i = 2, 3; cc(i) = 0; end;
if cc2 = 1 then do i = 3; cc(i) = 0; end;
Basically, this code ...
-2
votes
2
answers
159
views
Query to find all members of multi level many to many relationships and also the top most member of the hierarchy
Multiple student can go to 1 teacher, but 1 student can't go to multiple teacher. There is no limit of level in this teacher student hierarchy.
How using a single SQL query in SQL Server we can get ...
-2
votes
2
answers
72
views
Inserting root id to all its children
I have a table with hierarchy v_name
**id: name: child_id**
1000 abc null
1001 bac 1000
1002 cab 1001
1003 lop 1001
1004 jui null
1005 njj 1004
Now we are ...
2
votes
5
answers
95
views
Dropping grouped rows based on a certain hierarchical column
Suppose I have this pandas dataset:
ID
Question Code
1
Q01
1
Q01-1
1
Q02
2
Q01
2
Q02
2
Q02-1
2
Q02-1-1
2
Q02-2
I want to remove the rows based on certain hierarchical conditions between the values of ...
-1
votes
1
answer
103
views
Path table to HTML treeview in SQL Server
I have a SQL Server table with these rows:
id
path
1
a
2
a/b
3
a/b/c
4
a/b/c/d
5
a/b/c/e
6
a/b/f
7
a/b/f/g
8
a/h
9
a/h/i
10
a/h/j
etc...
I need a T-SQL script witch generate a treeview with ul, li tag ...
1
vote
1
answer
78
views
fixed-effect model matrix is rank deficient so dropping 5 columns / coefficients (lme4 package) after grouping age into four categories
This question appears to be a duplicate, I am however unable to resolve my case by looking at the existing suggestions on my model. I am trying to fit the three-level random intercept model. The idea ...
0
votes
1
answer
93
views
How to introduce a random error within a Bayesian count model?
I am trying to model counts distribute across groups in JAGS, but I need to add a random effect for the presence of multiple counts from the same individual.
The model is taken from here
enter link ...
0
votes
0
answers
64
views
Creating Node-Specific Tree Diagrams with Pyvis or Alternative Libraries?
I am working on generating hierarchical graphs using Pyvis. In my case, the nodes are not all connected to each other, so I would like to implement a dropdown menu that allows selecting a node by name....
1
vote
1
answer
56
views
How to use recursive function for product transition? [closed]
In Oracle SQL, I have a product transition table named kit_transition_mapping that is a slowly changing dimension and an orders table. For an order_no based on the order_date, I need to utilize the ...
1
vote
1
answer
28
views
MySQL Recursive CTE to retrieve all Attached Nodes of a Table
I have a recursive structure with the following two tables:
tree represents a hierarchy of nodes where the top node has parent = NULL.
the items can be attached to any of the tree nodes, anywhere in ...
0
votes
0
answers
15
views
algorithm to validate complex json data in a table which stores json key value pairs in column ,use it in another table which stores parent child data
1.extract all the key value pairs - suggest option which can be reused (temp table,CTE,or more suitable)
2.write a query which takes one key value at a time and searches for the value in another table ...
0
votes
3
answers
71
views
Transpose Hierarchical Table based on leaf nodes with roots as first column
This is similar to this one here. The difference is I want to display the roots in the first column (to the left)
I have a hierarchical table categories as follows:
id
name
parent_id
1
Accommodation
...
0
votes
2
answers
61
views
Transpose Hierarchical Table based on leaf nodes with nodes as first column
I have a hierarchical table categories as follows:
id
name
parent_id
1
Accommodation
null
2
Transport
null
3
Utility
1
4
Maintenance
1
5
Private
2
6
Public
2
7
Electricity
3
8
Gas
3
9
Internet
3
10
...
1
vote
3
answers
94
views
Oracle SQL hierarchical query data accumulation
I need to accumulate data in hierarchical query like this:
select
id,
prior id as parent_id,
count * prior count --need to be accumulated through whole hierarchy like sys_connect_by_path
from ...