Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sorting with wildmatch

Good day everybody,

I have a table with:

+ Type: POT, WD...

+ No: numeric value

I want to sort by with these conditions:

The first priority is "Type", the second is "No" and it should be in Ascending.

It worked well with Type = {POT, WD, FLT}  but with Type = "*" then the "No" field was not in order (ascending or descending)

Could you please suggest the idea. Thanks in advance.

I attached the qvw file & screenshot here.

1 Solution

Accepted Solutions
sunny_talwar

May be create a new field in the script like this

Sorting:

LOAD *,

WildMatch(Type ,'POT','FLT','WD','????????','R-*') * 1000000 + No as Sort;

load * Inline [

Type, No

Aug 2017, 42948

Jun 2016, 42948

Dec 2016, 42948

May 2017, 42948

And then sort for Max(Sort)

Capture.PNG

View solution in original post

4 Replies
sunny_talwar

May be create a new field in the script like this

Sorting:

LOAD *,

WildMatch(Type ,'POT','FLT','WD','????????','R-*') * 1000000 + No as Sort;

load * Inline [

Type, No

Aug 2017, 42948

Jun 2016, 42948

Dec 2016, 42948

May 2017, 42948

And then sort for Max(Sort)

Capture.PNG

Anil_Babu_Samineni

Looks like, This is not make sense to me. Because, You don't have common value for first dimension. Why you need this?

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
Anonymous
Not applicable
Author

Thank Sunny, it was a good solution, it is not correct 100% but I could work around with your idea.

Anonymous
Not applicable
Author

Hello Anil, thanks for your feedback.

I need to sort by "Type" field firstly  then by "No" field. After considering Sunny's solution I have this screenshot and it reach my expectation 90%.