Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.


Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Tree Traversal in Script possible?

Hi everyone.

I have a tree structure, which I am using QlikView for analyzing (probably not the best choice, but no other is available right now). Now I have to calculate a measure (criticality) of each node. A simple post-order traversal of the tree would be sufficient.

However, I have no clue on how to implement this either as an expression, preferebly as table in the script.

Here is some sample data, which is distributed in two tables:


Line  StationA   StationB

A-B   A             B

B-C   B             C

B-D   B             D

C-E   C             E

D-G   D            G

E-F   E             F


StationB   Num

B             14

C             10

D             8

E             2

F             6

G            4

As Output I would like to have a table in this manner:

line    criticality

A-B     50 (20+18+12)

B-C     18  (10+8)

B-D    12   ...

C-E     8

D-G    4

E-F     6

I don't want to calculate them by hand, because the number of records is much larger. If there is not "easy" or "efficient" way to do this in QlikView I woud probably do it in R.

Thank you in advance for some advice.

Best Regards


Tags (3)