Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Quick portal filter question

Featured Replies

Howdy, all:

I have this filter for a self-join portal:

Let ( [

indexValues = List ( TEACHER::_kplt_TeacherID ) ;

searchValues = List ( TEACHER::Name_LF__lct ) ;

index = ValueCount ( Left ( indexValues ; Position ( ¶ &  indexValues  & ¶ ; ¶ & TEACHER_X::_kplt_TeacherID & ¶ ; 1 ; 1 ) ) ) ;

prevValues = LeftValues ( searchValues ; index -1 ) ] ;

IsEmpty ( FilterValues ( TEACHER_X::Name_LF__lct ; prevValues ) ) )

 

The filter works fine as-is but I also want to include in it another constraint where names will only appear if the Status__lxt field (for each name/record) is set to "ACTIVE".  I tried different permutations of adding that bit but I just can't get the portal to work as wanted. 

TIA for your help!

Well you didn't say what you tried but usually you can just add it with an 'and', and maybe some parenthesis:

(First filtering parameters)

and

second filtering parameters.

I'd agree with Steve. you probably want

Let ( [

indexValues = List ( TEACHER::_kplt_TeacherID ) ;

searchValues = List ( TEACHER::Name_LF__lct ) ;

index = ValueCount ( Left ( indexValues ; Position ( ¶ &  indexValues  & ¶ ; ¶ & TEACHER_X::_kplt_TeacherID & ¶ ; 1 ; 1 ) ) ) ;

prevValues = LeftValues ( searchValues ; index -1 ) ] ;

IsEmpty ( FilterValues ( TEACHER_X::Name_LF__lct ; prevValues ) ) )

and

( Status__lxt = "ACTIVE" )

Does that work OK for you?

Edited by rwoods

You have titled this as "quick portal filter question", but I don't see anything "quick" about it. The method you use (taken from here) relies on a list of all related values in order to remove the duplicates. If the relationship does not exclude non-active records, they too will be included in the list. You cannot use such list to filter only active records. The idea here is it pass a value only if it's the first time it appears in the list - but the first occurrence may have been a non-active record, so this becomes utterly unreliable.

The simplest solution, IMHO, is to modify the relationship so that it only includes active records. Otherwise you would have to find an alternative way to produce the list - e.g. by a recursive custom function. Or devise a completely different method. None of these will be "quick".

 

  • Author

Thank you all! Steve and RWoods: I tried what you suggested but it didn't work, originally; however, when I changed the T.O. to the self-join table--instead of the "parent" table--it worked.

...but...

In a case of not seeing the forest through the trees, Comment's wisdom shines through and lights the way again: that making what appears to be a quick fix to solve the problem really doesn't solve the problem (or could make things worse when you expect data to appear where it should but it doesn't or it's wrong.) Thanks too, Comment, for inserting the hyperlink to the filter--my apologies to everyone for not including it in my original post.

Edited by WF7A

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.