Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SQL equivalent

Hello Experts,

Could someone please give me equivalent of below SQL script ?

  SELECT t1.id,
  t1
.parent_id,
  t1
.name,
  t2
.name AS parent_name,
  t2
.id AS parent_id
 
FROM tbl t1
 
LEFT JOIN tbl t2 ON t2.id = t1.parent_id
  START WITH t1.id = 1
  CONNECT BY PRIOR t1.id = t1.parent_id


I found solution to one of my tasks ( see previous thread How to find References of table entries recursively ? for more details)  using SQL. But i would request your help in resolving to QlikView Script.

11 Replies
Not applicable
Author

Thank you Evan for your all help.

I am consolidating a site which has data in Oracle tables. all the data that i listed in file 2 are related internally. So if i move one line item from site 1 to site 2 , i had to take all related object links. Hence that requirement.

I thought QlikView handles such cases internally or does in an efficient manner. But it also needs lots of manipulation.

evan_kurowski
Specialist
Specialist

Based on this latest description, all you need to do is this simple one liner, and you're done.  Miller time. 


Hierarchy
(id,parent_id,name,,name,hierarchy,'\',depth)  LOAD * RESIDENT [t1];