Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $300 before February 6: REGISTER NOW!
cancel
Showing results for 
Search instead for 
Did you mean: 
yangcelinexu
Creator
Creator

sorting fileds in filter

Hi

I am creating a filter have 3 filed (revenue, profit, profit_margin)

I want to have it as this order to show on the dashboard, any suggestion how could I sort?

Now is look like this

Screen Shot 2018-05-05 at 08.05.07.png

use expression?

or do you have any suggestion using some easier way to just reorder the fields ?

Thank you!

7 Replies
benazirkhan
Creator II
Creator II

You could try sorting by frequency if your data has more records for revenue, and next for profit and then for Profit-margin.

But if that's not the case - you should try the expression. (you could add an extra column to your data called Filter_flag and populate it as 1 for Rev, 2 for margin and 3 for profit.

Then use and expression to sort it using this field.

Let me know if that helps.

rgds,

Benazir

maxgro
MVP
MVP

you can sort by expression

mixmatch(yourfield, 'Revenue', 'Profit', 'Profit_margin')

maxgro
MVP
MVP

another option

1) load in a temporay table the values in the order you want at the beginning of the script

2) load other tables

3) drop the temporary table

the field is sorted (load order) as you define in step 1

// step 1

tmpSortField:

load * inline [

field

Revenue

Profit

Profit_margin

];

// step 2

Table:

load * inline [

field, val

Profit_margin, 1

Profit , 2

Revenue, 3

];

b:

load

pick(ceil(rand()*3), 'Revenue', 'Profit', 'Profit_margin') as field,

rand()*100 as val

AutoGenerate 1000;

// step 3

DROP Table tmpSortField;

sasiparupudi1
Master III
Master III

Use the expression

Pick (match (

'Profit_margin',

'Profit',

'Revenue')

,1,2,3)

ogster1974
Partner - Master II
Partner - Master II

Sort by expression

Valuelist(revenue, profit, profit_margin)

mikaelsc
Specialist
Specialist

yangcelinexu
Creator
Creator
Author

Thank you so much for all the input. All of them are working. --want to mark all as correct answers.

Thanks again for all the input!

I did it in another way. only works in this case because the number of Income>Profit>Profit margin

so I use expression just using sum(Total) as ranking