Aimar Arak Posted April 9, 2021 Posted April 9, 2021 What is possible solution to custom sort or some other way to sort not by display value in Page I have months list which is increasing during a year and it is populated like this: -SET &AEG = &AEG.(FIND MONTH_NR, MONTH_C IN VIEW_SELLE_AASTA_KUUD|SORT=ASCENDING ).Periood.; Filter shows month name (MONTH_C) values in page filter, but it sorts them alphabetical order (either asc or desc). How to make them to sort by month number (MONTH_NR) WF version is 8206.17 and Designer Page filter settings does not have such options.
Debra Waybright Posted April 9, 2021 Posted April 9, 2021 Have you added the Month Number field as the first BY You can have it not display, but then it would still sort first by that number. Or maybe Im not answering the question. You want them to sort in the filter display in numeric order, not on a report
Alexander Homer Posted April 13, 2021 Posted April 13, 2021 Hi Aimar, Assuming youre just trying to provide a filter prompt sorted by month name, there are a couple of ways you could do this, depending on whether you prefer to edit the metadata or the report procedure. If you are able to edit the metadata, simply changing the USAGE for the month name field in the Master File syntax from (what may be right now) an alpha format (like A12V) to a date format, like Mtr (full month name in mixed case), should allow WebFOCUS to understand that the values are month names and order them correctly. The field definition in the Master File may end up looking something like this: FIELDNAME=MONTH_C, ALIAS=MONTH_C, USAGE=Mtr, ACTUAL=A12V, MISSING=ON, TITLE='Month Name', DESCRIPTION='Month Name', $ One not-so-elegant way you could change the sort order at the fex level is by manually ordering the month values using a static list, like this. This is assuming all month values in your data are one of the 12 English month names: &MONTH_C.(January,February,March,April,May,June,July,August,September,October,November,December).Month.QUOTEDSTRING; Multiselect would look something like this: &MONTH_C.(OR(January,February,March,April,May,June,July,August,September,October,November,December)).Month Name.; If you want to show month names but need to pass month numbers, you could specify different display and actual values, like this: &MONTH_NR.(<January,1>,<February,2>,<March,3>,<April,4>,<May,5>,<June,6>,<July,7>,<August,8>,<September,9>,<October,10>,<November,11>,<December,12>).Month.;
Aimar Arak Posted April 23, 2021 Author Posted April 23, 2021 Hi. Thanks for solution. USAGE=Mtr just not working, crashes agent every time. I got it work with upgrade 8206.17 -> 8207.26. The code remains the same, fortunately sorting gets right. -SET &AEG = &AEG.(FIND MONTH_NR, MONTH_C IN VIEW_SELLE_AASTA_KUUD|SORT=ASCENDING ).Periood.;
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now