Jump to content
Server Maintenance This Week. ×

How to exclude records but keep data in calculations


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

Recommended Posts

  • Newbies

Help. Have written a financial database and need to find a way to eliminate/hide stocks from my portfolio when I have sold all of the shares but need to keep the financials from those stocks for calculations and summaries. Have tried including “archived“ in the key but then becomes cumbersome because I have to include a whole second relationship in each one of my calculations to capture the archived financials. 

Link to comment
Share on other sites

It's not quite clear what your question is. Some more details and a practical example would be helpful.

From your last sentence I get the impression that you have some calculations aggregating a related set, and you want to control if the related set includes "archived" records or not. Suppose the related records have an IsArchived field that contains either 0 (False) or 1 (True). In such case you can match this field with a global field on "this" side of the relationship and populate the field ad hoc with either 0 (show only active records) or 1 (show only archived records or both (as a return-separated list) to show the full set.

Another option is to base the calculations on the found set rather than a related set, and perform a find for the records you want to summarize at that moment.

 

Edited by comment
Link to comment
Share on other sites

  • Newbies

Thanks so much for the reply. Yes, more details. Financial database comprising a found set of currently invested stocks for 4 separate accounts. Each stock entry is related to a library of possible stocks as well as tables for share purchase/sell, dividends and options all related by a calc key of account+stock. When a stock is sold I need a way for it to no longer be displayed in the found set but retain any financials related to that stock, such as share, dividends, options, profit or loss. I basically need to hide those records when they are set to hide/archive , but have the ability to reactivate the stock in the event I want to reinvest in it. I currently have an active/archive field button that appears when share count goes to zero which will exclude that stock from the new found set but of course the financials are also excluded. Thanks 

Unless there is a better solution I have decided that I may just have to sort the records based on an active/archived field where the archived records are at the bottom. If I try to enter a new stock that is archived I can capture a find and reactivate that stock. Not terribly elegant but workable 

Link to comment
Share on other sites

This topic is 697 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.