Jump to content
Sign in to follow this  
Steve Martino

Sorting with list function (FM12)

Recommended Posts

Hi forum, I know I saw this before, but I can't really figure out how to properly search for it.  

What I have is a report.  In the header are 6 categories in a checkbox set, based on the Value list 'Categories', and it's a global field (gSearch).

When checking boxes, the OnObjectModify script trigger takes the value(s) searches and sorts the sub-summary part.  The sort on Category is based on the value list (not alphabetically).  So it the sort is in the order of the checkboxes you see in the screen shot.  All of this works fine.

What I was trying to accomplish was to put a merge field (gSearchParameters) in the header that states what boxes were checked (to be used when printed).  I did this with a global field, auto enter calculation:

Substitute(List(gSearch); "¶"; " | ")

This also works, but as you can see, and as expected, it puts them in the order they were checked, not the order of the checkboxes.

So, the obvious question is can I put the merge field in the order the checkboxes are shown, not as each box was selected?

Any help is always appreciated.

Thanks

Steve.

List.png

Share this post


Link to post
Share on other sites

If I understand this correctly (which is not at all certain), you want to do something like =

Substitute ( FilterValues ( ValueListItems ( Get ( FileName ) ; "YourValueList" ) ; gSearch ) ; ¶ ; " | " )

This will arrange the checked items in the order in which they are listed in the value list. Note that the List() function is pretty useless for this purpose. It is also redundant in your attempt - you will see the same result if you take it out.

 

The FilterValues() function leaves a traiilng ¶. If you don't want to have a trailing separator, you can do =

Substitute ( FilterValues ( ValueListItems ( Get ( FileName ) ; "YourValueList" ) ; gSearch ) & ¶ ; ["¶¶" ; "" ] ; [ ¶ ; " | " ] )

 

36 minutes ago, Steve Martino said:

 I did this with a global field, auto enter calculation:

An unstored calculation field would be more suitable, IMHO.

Share this post


Link to post
Share on other sites

Thanks (again) Comment, works perfectly

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.