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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I reverse sort a path and skip the first level?

How do I reverse sort a path and skip the first level?

Ex Path = P1:P2:p3

I want to show P2:P1?

Labels (1)
3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

subfield('P1:P2:p3' , ':' , 2) & ':' & subfield('P1:P2:p3' , ':' , 1)

Or a more general solution:

Reversing:

load MyPath, concat(Element,':',-row) as Reversed Group by MyPath;

load MyPath, iterno() as row, subfield(MyPath,':',IterNo()) As Element

Inline [

MyPath

p1:p2:p3

p4:p5:p6:p7

p8:p9:p10:p11:p12

] While IterNo() <= SubStringCount(MyPath,':');


talk is cheap, supply exceeds demand
Not applicable
Author

Hpw do I just reverse sort the string? is there a function?

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Not as far as I know. You could use this to reverse a string:

Reversing:

load MyText, concat(Letter,'',-row) as Reversed Group by MyText;

load MyText, iterno() as row, mid(MyText,IterNo(),1) As Letter

Inline [

MyText

Testmystring

SecondTest

AnotherString

] While IterNo() <= len(MyText);


talk is cheap, supply exceeds demand