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: 
nevilledhamsiri
Specialist
Specialist

Customer sorting

Hi members,

I need the branches to be sorted as like below.

1 RA

2 EH

3 K7

4 K9

5 EM

6 AS

7 TA

8 MY

I need this to be done in the form of an expression but not in the front end.

Thanks

Neville

 

2 Solutions

Accepted Solutions
JGMDataAnalysis
Creator III
Creator III

SortingMap:
MAPPING LOAD *
INLINE [
txt, num
RA, 1
EH, 2
K7, 3
K9, 4
EM, 5
AS, 6
TA, 7
MY, 8
];

NOCONCATENATE
LOAD
BRANCH,
PREMIUM,
Dual(BRANCH, ApplyMap('SortingMap', BRANCH, 100000)) AS BranchTemp
FROM [D:\CUSTOMER SORTING.xlsx] (ooxml, embedded labels, table is Sheet1);

DROP FIELD BRANCH; RENAME FIELD BranchTemp TO BRANCH;

View solution in original post

JGMDataAnalysis
Creator III
Creator III

You just have to add the BRANCH field as a dimension in a chart and make sure it is numerically ordered.

clipboard_image_34.png

View solution in original post

5 Replies
sunny_talwar

As an expression, but not on front end? what do you mean? Not sure I completely understand

nevilledhamsiri
Specialist
Specialist
Author

Yes,

It likes, I need this to be achieved not in the script level. May be as a calculated dimension etc

 

JGMDataAnalysis
Creator III
Creator III

SortingMap:
MAPPING LOAD *
INLINE [
txt, num
RA, 1
EH, 2
K7, 3
K9, 4
EM, 5
AS, 6
TA, 7
MY, 8
];

NOCONCATENATE
LOAD
BRANCH,
PREMIUM,
Dual(BRANCH, ApplyMap('SortingMap', BRANCH, 100000)) AS BranchTemp
FROM [D:\CUSTOMER SORTING.xlsx] (ooxml, embedded labels, table is Sheet1);

DROP FIELD BRANCH; RENAME FIELD BranchTemp TO BRANCH;

nevilledhamsiri
Specialist
Specialist
Author

Thanks JGMD

This is fine. If this is to be achieved in front end,how it will b done?

Thanks

Neville

JGMDataAnalysis
Creator III
Creator III

You just have to add the BRANCH field as a dimension in a chart and make sure it is numerically ordered.

clipboard_image_34.png