Jump to content

Portal Filtering - Using calculations to filter


db_tragic

This topic is 3782 days old. Please don't post here. Open a new topic instead.

Recommended Posts

This question is based on mr_vodka's Basic portal Filtering topic: http://fmforums.com/forum/topic/72108-basic-portal-filtering/

 

I want to use the concept described here, of using a drop-down list on a layout, to cause the embedded portal to be filtered based on the user's selection.

 

In this example, the filter options (drop-down list values) are based on a field value (Child_FMP11::Type).

 

Because I'm going to be using this on a portal containing invoice information, the filters will be based on a numeric calculation, not a fixed field value.

 

The calculations will be (aside from "All");

Invoice::Bal = 0

Invoice::Bal > 0

 

The sample file provided by mr_vodka includes the portal filter calculation:

 

Parent::gSelect = "All" or Parent::gSelect = Child_FMP11::Type

 

I just need some help with the second part of this calculation, to replace the "Type" field value with the 2 calculation options I mentioned above.

 

TIA

Link to comment
Share on other sites

IIUC, you want to replace filtering by type with filtering by balance, not add to it? If so, you could make your global field use a value list of: "All", Settled" and "Outstanding" or similar, then filter the portal using =

Parent::gSelect = "All" 
or 
Parent::gSelect = "Settled" and Invoice::Bal = 0
or
Parent::gSelect = "Outstanding" and Invoice::Bal > 0
Link to comment
Share on other sites

Thanks comment, yes, 'replace' is correct.

 

Thanks for the above - my first lesson in using 'or' and 'and' operators together! Shows nicely how a calculation can be associated with a value selected in a list - just what I needed.

 

 

 

IIUC, you want to replace filtering by type with filtering by balance, not add to it? If so, you could make your global field use a value list of: "All", Settled" and "Outstanding" or similar, then filter the portal using =

Parent::gSelect = "All" 
or 
Parent::gSelect = "Settled" and Invoice::Bal = 0
or
Parent::gSelect = "Outstanding" and Invoice::Bal > 0
Link to comment
Share on other sites

This topic is 3782 days old. Please don't post here. Open a new topic instead.

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

Important Information

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