Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sort by specified field values in a list box?

Hi all,

Does anyone know if its possible to sort by specified values in a field in a list box i.e. I have a list box with only four available options; Finance,  Corporate, Customer, Agents. I would like them sorted in that order. Is it possible to 'hard-code' the values so it will display in that order. I know i could put a number in front of them but i dont want to that really if possible.

thanks,

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi

     Hope the attached file will be helpful for your requirement

i attched qv file and excel file containg the sales field values(Finance,...)

Regards

Ashok

View solution in original post

12 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Its possible you can do it by using match function like

     =Match(FieldName,'Finance',  'Corporate', 'Customer', 'Agents')

Use it sort by expression

Hope it helps

Celambarasan

Not applicable
Author

Thanks for coming back to me Celambarasan. Its still doesent work. I'm using Qlikview 9, Listbox sort by expression (Asending). Its does not seem to be registering any of my logic as if i change the order in the logic around it dosent move.

My data comes from a datawarehouse (SQL). Would it be anything to do with the data type, i.e. 'Char' length is (20)?

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Qv9 doesn't support this.

     Then do one thing

     Load Dual(StringField,NumField) as FieldName

Inline[

          StringField,NumField

          Finance,1

          Corporate,2

          Customer,3

          Agents,4

     ];

Then set this dimension in numeric as Ascending order or load order as original;

If your going to use the load order then you should load this table before the that fields gets loaded from someother table.

Hope it helps

Celambarasan

Anonymous
Not applicable
Author

Hi

     I am triying to understand your requirement

          Your data(Finance,  Corporate, Customer, Agents....) all are in one field like sales

          You are retrieving this fieldName (sales) striaght from database right ?

Here you want assign some order value based right ?

Regards

Ashok

Not applicable
Author

Thanks for that,

Some stupid questions, dont really understand whats happening.

Should the inline statment be ran in the Load as part of the SQL? Is the 'String field' the column i'm referencing from the SQL?

The 'finance' value is actually 'Finance and Markering', is it ok to put an underscore. ?

Not applicable
Author

Yes thats exactly it Ashok. I want to order a 'Sales' column which is one field/coumn, straight from the database. It has only four possible values which i want to order in a particular way.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Its a separate table.

     Load this before the sql table gets executed.

     Here i'm using dual field which can act as both text and number in the way u need.so based on this i set the number field to the order that you want.

     You can use Finance as Finance and Markering no need to add underscore or any quotes.

Celambarasan

Anonymous
Not applicable
Author

Hi

     Hope the attached file will be helpful for your requirement

i attched qv file and excel file containg the sales field values(Finance,...)

Regards

Ashok

Not applicable
Author

That worked perfectly, thanks very much.

One other (last!) question. Its it possible to stop the list items 'jumping' to the top when their selected i.e. Fixed in their location?