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

Announcements
Solving the Informatica Dilemma: On-Demand Briefing - Watch On Demand!
cancel
Showing results for 
Search instead for 
Did you mean: 
alexpanjhc
Specialist
Specialist

How to sort this?

Hi

I have a sorting issue. Here it is

I have currently 7 unique numbers as following (I actually have 90 unique numbers)

IDNumber
120121
220121,20814,32105
343076,20126,55566
420814

all the unique numbers are :20121,20126,20814,32106,43076,55566

for each row, I want it the first position is always 20121, the second position is always 20126, and so on. If the row does not have this number, I will use 0 to fill it. so it will look like this.

IDNumber
120121,0,0,0,0,0
220121,0,20814,32105,0
30,20126,0,0,43076,55566
40,0,20814,0,0,0

I'd be highly appreciated if anyone please shed some lights,

I am not sure if this can be done easily in excel?

1 Solution

Accepted Solutions
ahaahaaha
Partner - Master
Partner - Master

Hi Alex,

Maybe so, as variant (attached files).

Result

1.jpg

The number of unique values in the script is determined automatically. All comments in the script code.

Regards,

Andrey

View solution in original post

5 Replies
Anil_Babu_Samineni

How you are doing in excel?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable

Could you pls share ur application once.

Frank_Hartmann
Master II
Master II

see attached sample!

hope this helps

ahaahaaha
Partner - Master
Partner - Master

Hi Alex,

Maybe so, as variant (attached files).

Result

1.jpg

The number of unique values in the script is determined automatically. All comments in the script code.

Regards,

Andrey

alexpanjhc
Specialist
Specialist
Author

Hi Andrey

This is very very helpful.

Can you explain what is your first step doing using while?

I know itno() will increase by 1 each time you execute it. How did the substringcount(number,',') effect in here?

This is a great solution and I just need to understand how it worked.

Thanks!