Jump to content
Sign in to follow this  
moonunit

Abstraction & evalution problem

Recommended Posts

I've got a table consisting of records which detail values that change occasionally, each change represented by a new record.

As the value is extracted from this table to another by script, there isn't much need to have more than two records at any one time. [Record 1 – first value. Record 2 – new value]

The script calls either record, by selection, and as it runs, it pastes a date specific to the other table, back into a date field on this table. This date field then triggers an evaluation calc which forms an audit trail.

So far, so good – all working fine.

95% of the time the script will run either from a single record [1 of 1] or the most recent, second record [2 of 2], but every once in a while, when updated info is received late for instance, things get a little more complicated and I have to run the script on record 1 [1 of 2]

To get around this, I've created a global calc field, coupled with a calc which subtracts the original value from the new global value, giving me the difference and allowing me the opportunity to run the script from the first record and a subscript which enters the difference as a separate transaction/record.

                   Value          g_Value               diff

Record 1            100             150                  50

Record 2            150             150                   0 

I wanted to create a second audit log triggered on a second date field, which would show the subscript date and the 'difference', but it won't work because the calc can't be stored...

This is presumably because the difference is calculated on a global... But when I remove the difference from the second evaluate calc, it still tells me it can't be stored.

So what's up with the second evaluation calc – when it's all but the same as the first? And how do I abstract a global so that it can be used?

Any help would be appreciated.

Share this post


Link to post
Share on other sites

Perhaps you should investigate this:

http://www.databasepros.com/FMPro?-DB=resources.fp5&-lay=cgi&-format=list.html&-FIND=+&resource_id=DBPros000333

Because I by and large thinks you're approaching things pretty healthy, all things considered, instead of the use of either aggregate or summaryfunctions.

--sd

Share this post


Link to post
Share on other sites

Thanks Søren,

I'm pleased to have your esteemed view.

Okay: I've got the download and in terms of a self-join, it was an abstraction route I was thinking of. But I'm not actually trying to get a value from the preceeding record; I'm in the previous record, and my secondary evaluation will stay in this record. So are you suggesting that I abstract the whole process, making lookup's of both the second date and value?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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