Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hierarchy-Befehl fehlerhaft?

Guten Morgen,

Vielleicht bin ich hier besser aufgehoben.

Ich stehe hier gerade vor einem merkwürdigen Problem und hab keine Ahnung was ich da machen kann.

Ich hab unsere Artikel mit dem HIERARCHY-Befehl aufgeschlüsselt, um zu sehen, was wo eingeht. Der HIERARCHYBELONGSTO-Befehl ist ebenso fehlerhaft an der Stelle.

Eltern_Knoten_Menge.jpg

Hier ist die Tabelle vor der Auflösung zu sehen. Wie man deutlich sieht, geht in den Artikel 4311860der Artikel 28000079 mit der Menge 1,455 ein. Wenn ich nun die Hierarchie auflösen lasse, dann passiert folgendes:

Hierarchie.jpg

Hier ist die 4311860 der letzte Artikel. Was aber nicht stimmen kann, wie das obige Bild zeigt.

Die 4312018 besteht zu dem 4311860 noch aus den Artikeln 28000079 und 2500120F. Kann das damit zusammenhängen? In anderen Fällen taucht der Artikel dann aber zweimal auf.

Hat jemand eine Idee? Die 4311860 ist auch nicht in der ersten Spalte "ElternID" zu finden wie alle anderen Artikel. Ich habe keinerlei Einschränkungen gesetzt, weder beim Einlesen noch bei der Anzeige in der Tabelle

LG Vicky

Labels (1)
10 Replies
whiteline
Master II
Master II

Isn't It a cycle ?

Not applicable
Author

Is it?

Maybe, but it depends. It shows two options. Sometimes we produce the article 4311860 in our workshop, then we need 1.455 kg from the material28000079, sometimes we buy it, so we don't need the 1.455 kg. But the article above needs nowadays 0 kg from the material 28000079.

Any tipp how I can see it nevertheless? Should I only load in such article with amount > 0?

whiteline
Master II
Master II

Ok, may be, it isn't

Could you submit some sample (with reduced or scrambled data) ? Or at least the name of the fields in your first table.

Not applicable
Author

I hope the sample data are ok.

The original table has only 3 fields: article, material, amount.

The hierarchy is 

HIERARCHY (child, parent, childname)

LOAD

article as parent,

material as child,

material as childname,

amount as quantity

whiteline
Master II
Master II

As I've said, it's a cycle.

parent child amount
4311860 28000079 1,455
4312018 28000079 0

QlikView process the hierarchy neglecting all cycles. So you have only one occurance of 28000079.

Hierarchy assumes:

- (parent, child) as connections between nodes

- IDs of each node in a Tree is unique.

- The data represents a simple tree without cycles.

I think you have to separete your hierarhical catalog (for groups) from the amount data (for items).

Not applicable
Author

Wuah, yes, I see. It's worst! Sorry.

But I need the amount data from every step.

I have to do the statement, how much material we need for this article (the first one in the line) and then I have to go through the hierarchy and summarize the amounts. How can I do that? Loading only datas with amount > 0?

For example:

A -> 1x B, 2xC, 3xD

C -> 1xF, 2xG

D -> 3xH, 1xI

So I need for A => 1xB, 2xF, 4xG, 9xH, 3xI

whiteline
Master II
Master II

You should understand what means that cycle and how it is suitable to break it.

Usually, in such cases, the hierarchy as a catalog is loaded in one table. This represents the groups.

And numerical values associated with that hierarchy to another table.

Your values '0' and '1,455' belongs to a different positions of the tree, so that you have to use some complex key to represent that connection instead of just childID (as you  implicitly do now).

Not applicable
Author

Maybe, I'm slowly with thinking these days. Sorry!

I have build up an example app to find the right way of handling such cases. I use only letters, but in the example app I see all the containing materials of A with the letter L I have build up the example of yesterday with the loop. I understand that this was a loop, but here I see all.

PS: Now I'm totaly confused. I have seen old notes where I have printed the hierarchy for one article. Not the same one, but with same conditions. Is it possible that the hierarchy-function is been improved between the version 10 and 11?

whiteline
Master II
Master II

Hmm.

This one seems to work fine.