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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sort chart by Listbox Selection

Hi,

What I'm trying to create for my report is a listbox containing fields of a table.

My goal is for the user to be able to sort the table based on the selection they have made in the list box.

For example:

Listbox:

Name

Inception Date

Cover No

Premium

Cover Status

Table:

NameInception DateCover NoPremiumCover Status
Tony11/06/2013A0001$200Bound
Matt11/05/2013A0002$50WIP

If the user chooses Name - the chart sorts by "Name" and alphabetical order.

If user chooses Premium - the chart sorts by "Premium" and lowest to highest amount.

What I've done so far is load this into the script (Fields from my actual data):

LOAD * INLINE [

    _Sort, _Result

    Conservation Ref, conservationid

    Trading Name, tradingname

    ABN, abn

    Inception Date, inceptiondate

    Conversation Status,conver_state

];

I created a variable and called it "vSort" which = "_Result".

Then In my table I sorted by expression and input "=($(vSort))".

I then created a listbox using "_Sort".

The problem I am having is that When I click a field which only contains numerical data, it will sort by it, however, when trying to sort by a field which contains text, it won't sort at all.

I'm kind of at a loss at the moment, so any help would be greatly appreciated.

Tony

2 Replies
whiteline
Master II
Master II

Hi.

You have to create a corresponding numeric field for each text field with sort weight value.

Not applicable
Author

Thanks whiteline.

It was indeed the right path to take.

I found the answer to my problem through this thread:

http://community.qlik.com/message/349829