Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
countryacronym field with values
US.ICE-FUTURES
US.Future
US-Miam
US.mik
I want to sort this by symbol like (.) should be 1st position and _ should be last
Need my output like
CountryAcronym--this is my field name
US.Future
US.mik
US.ICE-FUTURES
US-Miam
Maybe?
Match(CountryAcronym, Dual('US.Future',1), Dual('US.mik',2), Dual('US.ICE-FUTURES',3), Dual('US-Miam',4))
May be create island table like this and associate to your data model by any suitable key -
Load
Dual(CountryAcronym,[Sort Order]) as CountryAcronym inline [
CountryAcronym, Sort Order
US.Future, 1
US.mik, 2
US.ICE-FUTURES, 3
US-Miam, 4
];
Thanks for your reply brunpierre
These are not static values.every month data will change so the country acronyms will change.so anything comes with . Should come 1 anything comes with - should come last
Thanks for your reply digvijay
These are not static values.every month data will change so the country acronyms will change.so anything comes with . Should come 1 anything comes with - should come last
as below, Create a custom sort order field
Load
Ticker
,if(index(Ticker ,'.'),1,2)&Ord(upper(Ticker))&Ord(coalesce(subfield(upper(Ticker),'-',2),subfield(upper(Ticker),'.',2))) as Ticker_Sort_Order
inline [
Ticker
US.ICE-FUTURES
US.Future
US-Miam
US.mik
];
Under Sorting >> Choose Sort By Expresssion >>
= Min(Ticker_Sort_Order)
I found solution for this
If(wildmatch ([country acronyms],'*-*'),1)
Put sort expression in ascending order
this way you loose alphabetical sorting
Thanks for your reply viniemel2
We don't need to sort by alphabets
Agree with u iam losing my alphabetical sorting.i have used
Load
Ticker
,if(index(Ticker ,'.'),1,2)&Ord(upper(Ticker))&Ord(coalesce(subfield(upper(Ticker),'-',2),subfield(upper(Ticker),'.',2))) as Ticker_Sort_Order
inline [
Ticker
US.ICE-FUTURES
US.Future
US-Miam
US.mik
];
Your expression and it is giving alphabetical sorting which is correct but in my scenario i need alphabetical except - thing.if i have -it should come last