Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Custom Order in Sort (eg: C, A, B, F, D)

I have a table as follows. In the chart I want to display Sum(Age) but in the custom order of C, A, B. How can I do that . Load Order cannot be implemented in this case.

LOAD * INLINE [
Name, Age
A,20
B, 10
C,45
];

5 Replies
Not applicable
Author

Hi,

Usualy I create a table with one field in custum order.
then I can use "load order".

Something like this:

ordertable:
LOAD * INLINE [
Name
C
A
B
];
datatable:
LOAD * INLINE [
Name, Age
A,20
B, 10
C,45
];


Alex



Not applicable
Author

hi,

i have attached an application here.pls refer to it

i have set the sort order for name as expression descending and used sum(age) as expression

thanks

Not applicable
Author

Hi , This is based on sum(Age), what I want is the ability to specify the order .. eg ( B, A, C or C, A, B or B, C, A)

vupen
Partner - Creator
Partner - Creator

You may add another column that can be used for the right sort order.


temp1:
Load
*
;
LOAD * INLINE [
Name, Age, SortOrder
A,20,2
B, 10,3
C,45,1
];
temp:
NoConcatenate Load
*
Resident temp1
Order by SortOrder
;
Drop Table temp1;


pgrenier
Partner - Creator III
Partner - Creator III

Good day,

There are two types of approaches you may use to obtain your goal:

A) Use of an inline load statement to set the sequencing order of a dimension.

When QlikView loads information related to a given field, it creates a list in memory of all the different existing values it meets during the load process, storing them in the order they are met. In other words, if you add an inline statement before loading your core data, in which you define the logical order in which the info should be displayed, QlikView will create that list of values in memory in the order you have selected, which will allow you to then use the "Load Order" option under the Sort tab for your field.

B) Adding a extra field in the table to define the data sort order

Adding an extra field (SortOrderField) can allow you to specifically define the sort order, or maybe reuse the sort order defined in the source system for your data. In this case, you may opt to select the "Expression" sort by type in your graph for the concerned field, and put down Only({1} SortOrderField) as the sort expression.

Cheers,

Philippe