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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

if then loop

I have the following table:

Entry No.Reference No.Document No.
1AAA
2BBB
3CCC
41DDD
52EEE
63FFF
74GGG
87HHH

Entry No. is a unique Number. Entry nos 1 to 3 are staring numbers, the balance are linked numbers,. for eg. entry no 8 is linked to 7 which in turn is linked to 4, which in turn is linked to 1. Because there is no reference against 1, it is the the starting number

i want the results as below:

Entry No.Reference No.Document No.
81AAA

For entry no. 8, the links end at entry no. 1 and corresponding reference against 1 is AAA.

Can anyone help me with this in qlikview.

1 Solution

Accepted Solutions
Not applicable
Author

Hi Kartik,

Please find the qvw attachment.

http://community.qlik.com/docs/DOC-5490

Regards,

Joshmi

View solution in original post

5 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

See this blog post: Unbalanced, n-level hierarchies

And this document: Hierarchies


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Kartik,

Please find the qvw attachment.

http://community.qlik.com/docs/DOC-5490

Regards,

Joshmi

Not applicable
Author

Thanks Joshmi,

but it is determining reference no. only for the first entry no. in the above example, it has given the output for entry no.1 , it should also show output for entry no. 5 and 6 whose source no is 2 and 3 respectively.

Entry No.Reference No.Document No.
81AAA
52BBB
63CCC
Not applicable
Author

Hi Kartik,

PFA

Not applicable
Author

Dear Joshmi,

One more help. the formula you provided works well. But practically in my company, we have more than one Ref against an Entry.

Test:

LOAD * INLINE [

  

Entry No.Reference No.Document No.
1AAA
2BBB
3CCC
41DDD
52EEE
62FFF
74GGG
87HHH

For eg. in the above table, Entry 5 is from 2 and Entry 6 is also from 2.

This is possible when entry 2 has 100 Qty's and 50 are issued under Entry 5 and balance 50 under entry 6.

in such a case, the output should be as follows:

Entry No.Reference No.Document No.
52BBB
62BBB

please help.