Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Sorting in list box

Hi all,

I am very new to qlikview and right now I am using the free personal edition to see what this BI tool can do.

For my question, I have a list box with the values:

Apr

Aug

Feb

Dec

Jan

Jul

Jun

Mar

May

Nov

Oct

Sep

1. How can I custom sort this list to Jan, Feb, Mar, and so on?

2. Everytime I choose a value in this listbox, it promotes that value to the top of the list. How can I make it stay in its original position?

Thanks in advace.

1 Solution

Accepted Solutions
jsn
Honored Contributor

Re: Sorting in list box

Hi,

Right now your monthnames are just text values. You can either load them as proper date values by deriving the Month() name from a timestamp, or if you just create the field manually, try sorting them by load order.

For question #2, try disabling the "State" = Auto Ascending sort option under your listbox > Sort properties.

5 Replies
jsn
Honored Contributor

Re: Sorting in list box

Hi,

Right now your monthnames are just text values. You can either load them as proper date values by deriving the Month() name from a timestamp, or if you just create the field manually, try sorting them by load order.

For question #2, try disabling the "State" = Auto Ascending sort option under your listbox > Sort properties.

Not applicable

Re: Sorting in list box

Hi Johannes,

First of all, thank you for replying.

As I said in my first post, I am very new so please bear with me :-)

1. I unchecked all checkboxes under the SORT and just left LOAD ORDER and it worked, great.

2. Got this one, thanks.

Not applicable

Re: Sorting in list box

Just a follow up on #1.

What if I want it sort in any other way other than ascending, descending or according to the original data load? Is there anyway I can define this custom sorting?

jsn
Honored Contributor

Re: Sorting in list box

Not sure how you load the months now, but if you do it as an inline load, you can just add a numeric field for sorting like this:

LOAD * INLINE [

    Month, MonthSort

    Feb, 2

    Jan, 1

    Apr, 4

    Mar, 3

    May, 5

    Jul, 7

    Jun, 6

    Sep, 9

    Aug, 8

    Nov, 11

    Oct, 10

    Dec, 12

];

Now you can sort the field by "Expression" and just put in MonthSort as the sorting expression

Not applicable

Re: Sorting in list box

Hi Johannes,

The field Month is part of the Excel table I loaded through DATA FROM FILES, TABLE FILES.

I am attaching the code when I click on the EDIT SCRIPT:

Where do I place the code that yuo have suggested?

Thanks

Community Browser