Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting chars in a string.

Hi guys,

I´m trying to find a solution to do a sort inside the string, but I´m newbie in Qlik and I don´t know how to solve this problem.

I´m using Qlikview 12 Personal Edition.

Example: Imagine a table, where exist a field called "Name". Now, I want to create an expression that take every string in the "Name" field and do a sort in it as "Name_Sorted". Please, look at the table below.

NameName_Sorted
josepejops
johnhjno
mariaaaimr
fedcbaabcdef

Any suggestions on how to do this?

Thank you and sorry for my english.

Diego

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe

LOAD RecId, Concat(Char) as Sorted,

  Name

GROUP BY RecId,Name;

LOAD Mid(Name,iterno(),1) as Char,

  Iterno() as Index,

  Recno() as RecId,

  Name

WHILE iterno() <= Len(Name);

LOAD Name

FROM

[https://community.qlik.com/thread/233512]

(html, codepage is 1252, embedded labels, table is @1);

View solution in original post

2 Replies
swuehl
MVP
MVP

Maybe

LOAD RecId, Concat(Char) as Sorted,

  Name

GROUP BY RecId,Name;

LOAD Mid(Name,iterno(),1) as Char,

  Iterno() as Index,

  Recno() as RecId,

  Name

WHILE iterno() <= Len(Name);

LOAD Name

FROM

[https://community.qlik.com/thread/233512]

(html, codepage is 1252, embedded labels, table is @1);

Not applicable
Author

Hi Stefan,

It worked great.

Thank you.