Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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,

Tags (1)
1 Solution

Accepted Solutions
chandashok
Not applicable

Re: Sort by specified field values in a list box?

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

12 Replies
celambarasan
Not applicable

Sort by specified field values in a list box?

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

Sort by specified field values in a list box?

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

Sort by specified field values in a list box?

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

chandashok
Not applicable

Sort by specified field values in a list box?

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

Sort by specified field values in a list box?

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

Sort by specified field values in a list box?

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

Sort by specified field values in a list box?

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

chandashok
Not applicable

Re: Sort by specified field values in a list box?

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

Re: Sort by specified field values in a list box?

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?