Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone ,
I want to implement custom sort on country. i have already tried below two approaches
1. Sort expression match(Country, 'Sweden', 'Denmark', 'Norway', 'Others')
2. in Script creating n inline table
CountrySort:
MAPPING Load * inline [
"Country " , Sort
Denmark,2
Sweden,1
Norwary,3
Other,4
];
Dual("Country ",Applymap('CountrySort',"Country ")) as "Country"
both gives me wrong order.
Any suggestions
In the back end write in preferred sorting order. Simply write InLine with the same field name you wish to sort. Like
temp_sort_country:
LOAD * INLINE [
Country
Sweden
Lithuania
Denmark
USA
];
At the end of the back end script drop the table.
Drop Table temp_sort_country;
Another approach
CountrySort:
Load *, Dual("Country ",Sort) as Dual inline [
"Country " , Sort
Denmark,2
Sweden,1
Norwary,3
Other,4
];
Now you can call, Dual field in sort expression
If using the temp_sort_country table, make sure you uncheck all the sort options to cause it to use the load order.
-Rob
In the back end write in preferred sorting order. Simply write InLine with the same field name you wish to sort. Like
temp_sort_country:
LOAD * INLINE [
Country
Sweden
Lithuania
Denmark
USA
];
At the end of the back end script drop the table.
Drop Table temp_sort_country;
where are you trying to have a custom sort
Another approach
CountrySort:
Load *, Dual("Country ",Sort) as Dual inline [
"Country " , Sort
Denmark,2
Sweden,1
Norwary,3
Other,4
];
Now you can call, Dual field in sort expression
Hello,
Nope it didn't work. I have created a tale with preferred order n drop that table at very end of script. but still its shows wrong order.
I have tried in Chart--> sorting--> sort by expression and
in data editor .
Hi
Can u please attach the QVF?
Thanks
If using the temp_sort_country table, make sure you uncheck all the sort options to cause it to use the load order.
-Rob
Hello,
Thanks for replying i tried but for some reason it didn't work.
I have a dim and in sorting i have added 'Dual' new field , it didn't work. Than i tried
match(Dual, 'Sweden','Denmark','Norwary','Finland','Other') it didnt work either
Yes i have cross checked that too. i have a filter panel with one dim ie country ,