If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.
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
use expression?
or do you have any suggestion using some easier way to just reorder the fields ?
Thank you!
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
you can sort by expression
mixmatch(yourfield, 'Revenue', 'Profit', 'Profit_margin')
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;
Use the expression
Pick (match (
'Profit_margin',
'Profit',
'Revenue')
,1,2,3)
Sort by expression
Valuelist(revenue, profit, profit_margin)
create dual() values for your field values in your script...
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