Mark Mcdonald Posted April 1, 2009 Posted April 1, 2009 I'm trying to figure out the best way to return a subset of records by, in this case, a date. I could make a script to find all records with a specific date but there's a ton of records and it's fairly slow to do so. So what I was hoping was that I could use relationships instead. I've tried using a self-join with the Record Date matching to a global date field that I'd use as the filter. This gives odd results. Are self-joins the wrong approach or is it a matter of incorrect execution?
*susan* Posted April 1, 2009 Posted April 1, 2009 Mark, Searching on a date field shouldn't be slow. Is the date field an unstored calculation? If so, it won't work as the "right" side of a relationship. Assuming that the date field is stored, you can have a global date field [gDateSelect] with a relationship to dateField. At this point, you could Go To Related using this relationship, or show the resulting records in a portal. The relationship should look something like this: TABLEA-gDateSelect == TABLEA-dateField Is this helpful? *susan*
Mark Mcdonald Posted April 1, 2009 Author Posted April 1, 2009 Hi Susan, Yes, this helps - however it returns to using portals which I think are user-interface nightmares. For the work I'm doing I prefer using the table view since it allows more fluid re-arrangement of information. Is there a way to enable portal-like functionality in a table view? Thanks! Mark
*susan* Posted April 1, 2009 Posted April 1, 2009 If you don't want a portal, go to the related records to display in table view. *susan*
Mark Mcdonald Posted April 1, 2009 Author Posted April 1, 2009 Thanks, I'll try that. Somewhat relatedly, I'm using some basic calculation fields to determine whether a field has changed given a start date and and end date (using self-joins). The calculation itself works fine but searching against the result is dead slow. I've created an indexed field to cache the result but it has to be refreshed every time the date parameters change (this takes a while). Is there a better way to approach this?
Mark Mcdonald Posted April 1, 2009 Author Posted April 1, 2009 (edited) Sure - it's pretty simple - along these lines: If (mainTable_selfJoin1::Data = mainTable_selfJoin2::Data) ; 0 ; 1) Thanks, m Edited April 1, 2009 by Guest
comment Posted April 1, 2009 Posted April 1, 2009 I am afraid that's not clear enough. mainTable_selfJoin2 is a field? I suspect you don't need this calculation and that you could just search the field where your original stored data is - but I cannot say for sure without a better description.
Mark Mcdonald Posted April 1, 2009 Author Posted April 1, 2009 Sorry typo - I've edited it. I'm checking the content of a field on one date against itself on a second date. I'm using the self-joins for display reasons primarily - is there a way to do this calculation without using references? Sorry if I'm a bit fuzzy, self-join type issues make my head hurt.
comment Posted April 1, 2009 Posted April 1, 2009 It makes my head hurt too, because I don't see your relationships - so I cannot understand what the calculation does. Could you explain what is the actual purpose behind this?
Recommended Posts
This topic is 5774 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 accountSign in
Already have an account? Sign in here.
Sign In Now