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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
lakshmanvepuri
Creator
Creator

Reg: Custom Sorting on Fields in the Columns

Hi,

Please help on the below request.

Table Name is Module

Column Name is ZONE

Data in the Zone is :

FRONT

BACK

NO DATA

POST

I am able to sort in Ascending or Descending order.

I want the sorting as given below.

FRONT

BACK

POST

NO DATA

Thanks a lot

Lakshman

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Hi Lakshmana,


Go to property and select sort tab.


Write the below in expression tab.


=Match(ZONE ,''FRONT' , 'BACK' , 'POST', 'NO DATA' )

Capture.PNG

View solution in original post

5 Replies
effinty2112
Master
Master

Hi Lakshman,

This is a good little tip for doing this:

Create a temporary table

TempTableToSetLoadOrder:

LOAD * INLINE [

    ZONE

    FRONT

    BACK

    POST

    NO DATA

];

This sets the load order the way you want it.

At the end of the load script

DROP TABLE TempTableToSetLoadOrder;


The table might be dropped but QlikView has already set the load order of the field values.

In your charts set the sort order of the field ZONE to Load Order.

Regards

effinty2112
Master
Master

Hi,

     An other way to do it without changing the script is to set the sort order to the expression:

Match(ZONE, 'FRONT', 'BACK', 'POST, 'NO DATA')

Cheers

Mark_Little
Luminary
Luminary

Hi,

you can and ordering field on load.

Something like

IF(Field = 'FRONT', 1,

    IF(Field = 'BACK', 2,

          IF(Field = 'POST',3

              IF(Field = 'NO DATA',4)

              )

          )

    ) As OrderNo,


Mark

tamilarasu
Champion
Champion

Hi Lakshmana,


Go to property and select sort tab.


Write the below in expression tab.


=Match(ZONE ,''FRONT' , 'BACK' , 'POST', 'NO DATA' )

Capture.PNG

NareshGuntur
Partner - Specialist
Partner - Specialist

Load * Inline [

ZONE, SORT

FRONT, 1

BACK, 2

POST, 3

NO DATA, 4

];

And under sorting in the front end, use the field "Sort" in Ascending order.

Cheers,

Naresh