Jump to content
The ibi Community has moved to a new platform: Please Sign In and choose Forgot Password to continue

What is possible solution to custom sort or some other way t...


Aimar Arak

Recommended Posts

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.

Link to comment
Share on other sites

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.;

Link to comment
Share on other sites

  • 2 weeks later...

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.;

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...