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

Filtered Portal Calculation

Featured Replies

Please help me with my calculation below, what I'm trying to say is:

Show records in the portal (filtered) if the following conditions are met:

LSP::ACCT CODE 1 = "q"

LSP::QUOTED STATUS = 0 or " "

and get user name, if user name is Matt then show records with LSP::PRODUCER CODE = 3

if user name is Kim, then show records with LSP::PRODUCER CODE = 2

etc etc.

 

Here is what I have so far:

LSP::ACCT CODE 1 = "q" and (LSP::QUOTED STATUS = 0 or " ") and

Case (
Get(UserName) = "Matt"; 3;
Get(UserName) = "Kim"; 2;
Get(UserName) = "Bill"; 9;
) LSP::PRODUCER CODE = 3 )

 

Thoughts?

Comparative expressions ( using say, the = sign) need to be compared individually. So it should be:

 

LSP::QUOTED STATUS = 0 or LSP::QUOTED STATUS = " "

 

And I don't know what you're doing in that Case() statement.

 

I like using Let() when I can. And others here disagree, but I like parens for clarity:

I would write it:

 

Let([

acct.code.true = ( LSP::ACCT CODE 1 = "q" ) ;

status.true = ( LSP::QUOTED STATUS = 0 ) OR  ( LSP::QUOTED STATUS = " " ) ;

user = Get ( UserName ) ;
user.code =  Case ( user = "Matt"; 3 ; user = "Kim"; 2; user  = "Bill"; 9 ) ;

producer.code.true =  ( LSP::PRODUCER CODE = user.code ) ;

 

 

result = acct.code.true AND status.true AND producer.code.true

];

result

)

Edited by David Jondreau

what I'm trying to say is:

 

… probably this:
 
Let ( [
  ~user = Get ( UserName ) ;
  ~status = LSP::QUOTED STATUS ;
  ~code = Case ( ~user = "Kim" ; 2 ; ~user = "Bill" ; 9 ; 3 ) // unclear about the trailing 3; if this is the default, you don't need to check on "Matt"
  ] ;
  LSP::ACCT CODE 1 = "q" 
  and 
  ( ~status = 0 or ~status = " " ) 
  and
  LSP::PRODUCER CODE = ~code
)
 

Thoughts?

 

Learn FileMaker calculation syntax  :D

Case (
Get(UserName) = "Matt"; 3;
Get(UserName) = "Kim"; 2;
Get(UserName) = "Bill"; 9;

 

Perhaps you should have a Users table where each user has a corresponding PRODUCER CODE, instead of hard-coding names and codes into calculation formulas like that.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.