Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
imhappiee
Contributor III
Contributor III

Hierarchy issue

Hi,

I have table as attached in the screen shot and with with I created a table  from source table to get the hierarchy

till to this extent i was good

but after this I was unable to bridge the hierarchy and the source table to get the values grouped up at hierarchy level

any help on this will be highly appreciated.

Kind Regards,

Anand.Capture.PNG

7 Replies
Gysbert_Wassenaar

Please post a qlikview document that demonstrates the problem.


talk is cheap, supply exceeds demand
imhappiee
Contributor III
Contributor III
Author

Ho Gysbert

I have attached the qvw to the main post , please help me out.

regards,

Anand.

Not applicable

Hello Anand,

Have you checked out this technical brief on hierarchies by hic

Hierarchies

Not sure but think your problem may be happening because some supervisor ids do not exist in the employee id field.

Gysbert_Wassenaar

See attached qvw


talk is cheap, supply exceeds demand
imhappiee
Contributor III
Contributor III
Author

Gysbert

To an extent this helps me but this need to be more fine tuned as the data is in the below format and i want that as mentioned in the image.Capture.PNG

where as in the current application that u helped me with, I could see that the employee who is at level 2 is coming in level1 .

so can u fine tune it more and get the result as desired and help me face this challenge.

Regards,

Anand.

imhappiee
Contributor III
Contributor III
Author

Sana,

Thanks for the post, I have gone through all this links before posting this question.unfortunately which didnt helped me much in this challenge 

Thanks

Anand.

imhappiee
Contributor III
Contributor III
Author

Hi

@Jakub Michalik hic‌  @hic

Based on the following post and you valuable suggestions for it

Re: Hierarchy - how to concatenate tables with different depth nodes

I tried looping the data for a specific month and creating hierarchy as per the following code , but was unable to achieve it, could you please help me on this as well

**********************************************************************************************************

absmonth_table:

load

Distinct

     abs_month

FROM

(qvd);

LET vAbs_mnthno = NoOfRows('absmonth_table');

FOR i=0 TO $(vAbs_mnthno)-1

  LET vAbs_mnth = peek('abs_month',$(i),'absmonth_table');

  TRACE *****$(vAbs_mnth)*****;

   // load filtered (by Dim1) data from qvd

  Hrchy_temp:

  Load

           '$(vAbs_mnth)' AS abs_filter,  *

  FROM C:\Anand\Section access proj_Sales comp\QVDs\Data.QVD (qvd)

   WHERE abs_month = '$(vAbs_mnth)';

NEXT

Hrchy:

NoConcatenate

HIERARCHY(employee_id, supervisor_id, employee_name, , , , )

load *

Resident Hrchy_temp;

 

drop tables absmonth_table, Hrchy_temp;      

exit script;

**********************************************************************************************************************************

Quick Note:

There is a possibility of employee getting shifted to a different manager (parent) in a month,

Eg:

absmonth    emp      sup

201505      arun       Ajay

201504      arun       arvind

so i need hierarchy based on abs month and then wanted to join all the the data of different months

Thanks In advance

Regards,

Happy