Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Filter with sort a default value

Hi guys,

I need a filter with sorting properties and default value.

I downloaded the bi-era list box with default value but I don't find anything reguarding the sorting.

Thanks

Alice

15 Replies
agigliotti
Partner - Champion
Partner - Champion

Hi Alice,

I suggest you to sort the field within your script

or take a look at Aggr function with sorting crtieria http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/ChartFunctions/aggr.htm#Sorting

shraddha_g
Partner - Master III
Partner - Master III

Anonymous
Not applicable
Author

It's fine but I initial selection doesnt'work I have  a field and I write Category='Total' and it doesn't work. Where am I wrong ?

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Alice,

The best way to get a specific sort order on a Filter Pane is to use a dual data type.  These have both a numeric and a string representation.  This means you can have a different sort order to the alphabetic one.

So, to have a filter that sorts the words one to four correctly it would be:

Map_Number:

MAPPING LOAD

  Name,Num

INLINE [

Name,Num

One,1

Two,2

Three,3

Four,4

];

Table:

LOAD

  Dual(Number, ApplyMap('Map_Number', Number, 99)) as Number

INLINE [

Number

Four

One

Three

Two

];

You will see that a filter pane based on this will sort correctly.

There is no "only one selected" or triggers in Qlik Sense (as there was in QlikView) so an elegant way to solve the default issue is to use Set Analysis in expressions.

First you would need to create a variable that returns the first sorted value (this can then be used in legends also).  In this example the name would be vFirstValue and the code:

=minstring({<Number={"=$(=min(Number))"}>}Number)

The code is a little convoluted, but basically you are finding the lowest numeric value and then find the string equivalent that goes with it.

You can then use this expression in Set Analysis expressions, so regardless of what is selected only the first sorted value is used in the expression:

=sum({<Number={'$(vFirstValue)'}>}Number)


Hope this all makes some kind of sense?

I've attached a QVF in the hope this makes things a bit clearer.

Steve

shraddha_g
Partner - Master III
Partner - Master III

Is it perfectly matching with value in category Field.

Try giving input without using ' (Single Quotes).

kumarnatarajan
Partner - Specialist
Partner - Specialist

Hi Alice,

You can follow as Steve suggested,

Else find the below link to download the updated extension file. It contains sorting options.

https://drive.google.com/open?id=0B7mtxGtlcr4QZDhkaEJFRUFEVEU

Regards,

Kumar

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Kumar,

Are these changes getting forked back into the GitHub repo that fredberg‌ is maintaining? Or is this essentially a new extension?

The Drive link currently requires access to be granted.  Could a public link be posted, or could it be uploaded elsewhere?

kumarnatarajan
Partner - Specialist
Partner - Specialist

No Steve,

The versions, I am not maintaining GitHub account.

I have given the access, now we can download from drive.

agigliotti
Partner - Champion
Partner - Champion

to unzip it a password is needed.

could you provide it?