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

Sub Field Caculation

Dear All,

Greeting for the Day...!!!

I have a requirement to find out the Main Filed and Sub field out of Hierarchy table.

Input Format:-

*A*B*C

*G*D

*U*F*J*K*L

*M*I*T*H*T*R*D*V

OutPut Table should be:-

Main GroupSub GroupLast Group
ABC
GD
UF L
UJL
UKL
MIv
MTv
MHv
MRv
MDv

Please help me out to get the solution for this.

Thanks!

D J

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

Load SubField(Txt,'*',2) As MainGrp, If(Cnt>2,SubField(Txt,'*',3+(IterNo()-1))) As SubGrp, SubField(Txt,'*',Cnt+1) As LastGrp While IterNo() <= If(Cnt>2,Cnt-2,1);

LOad *,SubStringCount(Txt,'*') As Cnt Inline [

Txt

*A*B*C

*G*D

*U*F*J*K*L

*M*I*T*H*T*R*D*V ];

View solution in original post

2 Replies
tresesco
MVP
MVP

May be like attached qvw.

anbu1984
Master III
Master III

Load SubField(Txt,'*',2) As MainGrp, If(Cnt>2,SubField(Txt,'*',3+(IterNo()-1))) As SubGrp, SubField(Txt,'*',Cnt+1) As LastGrp While IterNo() <= If(Cnt>2,Cnt-2,1);

LOad *,SubStringCount(Txt,'*') As Cnt Inline [

Txt

*A*B*C

*G*D

*U*F*J*K*L

*M*I*T*H*T*R*D*V ];