Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

amit_saini
Honored Contributor III

Hierarchie Issue !!!

Hi Folks,

Attached is my sample application.

Script:

PlantCategories:

LOAD Plant,

     [Plant Code],

     LeadPlant,

     Region1,

     [Product Groups]

FROM

(ooxml, embedded labels, table is Sheet1);

tmp_PlantHierarchie:

Hierarchy([Plant Code],LeadPlant, Plant, [ParentName]   )

Load

     [Plant Code],

   LeadPlant,

     Plant 

resident PlantCategories;

PlantHierarchie:

Left join (PlantCategories) load

     [Plant Code],

     Plant1 as LeadPlantName

resident tmp_PlantHierarchie;

drop table tmp_PlantHierarchie;

Problem :

Not sure why I'm not getting right value in "LeadPlantName" filed

It should work like below based on Plant Code and LeadPlant entries:

Please help!

Thanks,
AS

9 Replies
amit_saini
Honored Contributor III

Re: Hierarchie Issue !!!

Any suggestions???

Thanks,
AS

Re: Hierarchie Issue !!!

Try

PlantCategories:

LOAD Plant,

     [Plant Code],

     LeadPlant,

     Region1,

     [Product Groups]

FROM

[Book12.xlsx]

(ooxml, embedded labels, table is Sheet1);

tmp_PlantHierarchie:

Hierarchy([Plant Code],LeadPlant, Plant)

Load

  [Plant Code],

   LeadPlant,

     Plant 

resident PlantCategories;

Drop Table PlantCategories;

filip_duchateau
Contributor II

Re: Hierarchie Issue !!!

Hi,

Try using

PlantHierarchie:

Left join (PlantCategories) load

  [Plant Code],

    Plant as LeadPlantName

resident tmp_PlantHierarchie;

Instead of :

PlantHierarchie:

Left join (PlantCategories) load

     [Plant Code],

     Plant1 as LeadPlantName

resident tmp_PlantHierarchie;

Since Plant1 does not exist in table tmp_PlantHierarchie.

amit_saini
Honored Contributor III

Re: Hierarchie Issue !!!

Thanks Filip!

amit_saini
Honored Contributor III

Re: Hierarchie Issue !!!

Filip,

"Plant as LeadPlantName" this is giving me entries , but not the correct one.

It should be like below:

For example : Against "50016 Zaragoza, Spain" I should get output as "KT Barcelona" in LeadPlantName , because see below Lead Plant code is 11

Thanks,

AS

vikkyv
Contributor II

Re: Hierarchie Issue !!!

Please check the attched ,Is it the same that you are looking for ...

punitpopli
Contributor III

Re: Hierarchie Issue !!!

Hi amit.saini‌,

The below link might help you :

Hierarchy in QlikView

amit_saini
Honored Contributor III

Re: Hierarchie Issue !!!

Sorry,

I'm looking for attached output:

Thanks,

AS

vikkyv
Contributor II

Re: Hierarchie Issue !!!

Can you check this....It should work for you..

Community Browser