Jump to content
Sign in to follow this  
Wayne Irvine

Calculation updates

Recommended Posts

I have a look up table of products with parameters such as style, size, colour etc and of course price.

In another table I have the items ordered which allows you to choose a style, size, and colour and looks up the price form the products table.

I achieve this calculation using a field which contains a concatenated string like this 'style-size-colour' in both tables and a relationship based on this field. I use this relationship to return the price.

It works the first time, but when I change one of the parameters the price is not immediately updated.

How do I force a refresh?

Share this post


Link to post
Share on other sites
29 minutes ago, Wayne Irvine said:

I achieve this calculation using a field which contains a concatenated string

Is this field a calculation field? Or is it a text field with auto-entered calculated value? If the latter, did you deselect the `Do not replace existing value` option?

P.S. This arrangement is not necessary; you can define the relationship to match on the three original fields directly (assuming you're using version 7 or higher).

P.P.S Please update your profile to reflect your version and OS.

Share this post


Link to post
Share on other sites

It is a calculation field.

On the Relationship, do you make multiple relationship string between the tables?

Profile updated.

Share this post


Link to post
Share on other sites
4 minutes ago, Wayne Irvine said:

It is a calculation field.

Well, I cannot reproduce your problem (see attached file). When you say you "change one of the parameters", you mean in the Items table, right? In the same table where the lookup field is defined?

CompoundLU.fp7

 

10 minutes ago, Wayne Irvine said:

On the Relationship, do you make multiple relationship string between the tables?

You just add multiple pairs of matchfields in the Edit Relationship window. Or drag between another pair of matchfields to add it to an existing relationship.

Share this post


Link to post
Share on other sites

I got the multiple field relationships working and if I change a field manually it updates just fine. Never knew that was possible.

And I converted my calculations to lookups so the values will remain even if I change the prices later. Thanks for that.

I have one field which is DurNo which is of a calculation. I have a drop down field which is a list of values from a separate table (durations). The values are '1 hour', '2 hours' and 'Half hour' and they have the corresponding values 60, 120, 30. So when you select '1 hour' for the Duration the DurNo recalculates to the corresponding value and I thought this would trigger a recalculation of the cost. No go.

I changed the duration calculation to a lookup as well and it seems to have resolved my problem. Still not really sure why dependent calculations don't update though.

Edited by Wayne Irvine

Share this post


Link to post
Share on other sites

There is an button in the 'Specify Calculation' dialog called 'Storage Options'. Within that you can select 'Do not store calculation results - - recalculate when needed'.

This may reduce performance, since you are telling FileMaker not to store the results, but it will force recalculation of your field whenever FileMaker needs to reference it. Try choosing that and see if it resolves your problem.

Share this post


Link to post
Share on other sites
4 hours ago, Wayne Irvine said:

So when you select '1 hour' for the Duration the DurNo recalculates to the corresponding value and I thought this would trigger a recalculation of the cost.

We don't know how cost is being calculated. In general, an unstored calculation will not trigger anything. If cost is a stored calculation, and you want it to recalculate when Duration is modified, you need to reference the Duration field in the cost formula.

BTW, an unstored calculation field that does nothing but copy the related Duration value is redundant; you can simply display the related field directly.

Share this post


Link to post
Share on other sites
On 03/03/2017 at 8:03 PM, rwoods said:

There is an button in the 'Specify Calculation' dialog called 'Storage Options'. Within that you can select 'Do not store calculation results - - recalculate when needed'.

I couldn't use this as it it based on a related field.

22 hours ago, comment said:

We don't know how cost is being calculated.

I will modify your example and see if I can demonstrate. Before I do, can you accept fmp12 files?

Share this post


Link to post
Share on other sites
21 hours ago, Wayne Irvine said:

can you accept fmp12 files?

I can't, but others can. Or just describe the setup in words.

Share this post


Link to post
Share on other sites
On 3/4/2017 at 10:40 AM, Wayne Irvine said:

I couldn't use this as it it based on a related field.

I will modify your example and see if I can demonstrate. Before I do, can you accept fmp12 files?

You can use an unstored calc on the left hand side of a relationship, not the right. Take RWoods' advice. It will work.

Wayne,

Just a bit of general advice: Try using multiple predicates, instead of concatenating in another field, and always look for the option of storing values rather than calculating them. With script triggers this has become far easier.

Edited by ShaunB
typo

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Similar Content

    • By Richard Fincher
      My production Filemaker Server 14 running on Mac OS X 10.11 El Capitan (Not Mac OS X Server) has been running fine for a year since I last installed the Thawte SSL Certificate.  After renewing the certifate this year, I've tried various different methods of importing the new certificate, which came with an intermediate certificate, but I can't seem to get the intermediate certificate installed.  I've been mostly using something like:
      sudo fmsadmin certificate import --keyfile /Users/richardfincher/Desktop/GBROOMX36-4X/private.key /Users/richardfincher//Desktop/GBROOMX36-4X/ssl_certificate.crt
       
      I've also tried importing it through the web control panel.  It was necessary to remove the old private key thus.:
      sudo rm /Library/FileMaker\ Server/CStore/serverKey.pem
      After it is (apparently) installed, I usually restart with :
      sudo fmsadmin restart adminserver
      although a few times I have rebooted the server (not a VM)
       
      Any thoughts welcome....
       
      Oh, one thing is, a year ago it might have been still on Mac OS X 10.8.5 Mountain Lion, which was the previous OS before I upgraded it.
    • By Qam Qam
      hello every one 
      there is a way to send SMS without any plugins , 
      there is a teacher named (guy setvens) who have course on udemy to explain it , problem is its paid , i i cant afford it 
      any one knows how to do it 
      please 
      i have bought 10000 SMS with api form sms provider 
      but i dont know how to use it without plugins 
       
    • By Qam Qam
      Hello every one 
      i want to mention multiple filed in the email 
      like agent name 
      created by 
      and date of creation 
      to be sent to the manger 
      now i can only send one field  in the email 




    • By Qam Qam
      Hello everyone ,
      this is my 1st post in this helpful website 
      thank you guys ive learned a lot 
       
      iam working on recruiting software for my office 
      its simple 
      my issue now that i want to set simple days count down timer 
      for example if my client requested his procedure finish in 60 days or 90 days 
      i want to know left days in a list so i can give pioirty 
      so i used the following 
      GetAsNumber ( Contract_End_Date - Get ( CurrentDate ) )      
      which appears in the remaining days filed 
      it worked fine for me 
      the issue is 
      it remains  frozen , next day its the same value like yesterday 
       
      sorry for my bad English '
       
      please help me 
      thank you 

    • By DR. ALI BAHAR
      Dear All,
      I have tried to access the SQL database, through the ODBC, as a data source in the online filemaker solution but I am not successful , i don't know if i am missing something ?
      can any one help in this regard ?
      Thanks in advance.
      Regards
      Mr. Ali Bahar
      Pakistan.
  • Who Viewed the Topic

    11 members have viewed this topic:
    Robert Mota Hawks  V!ncent  gczychi  arni  Lee Smith  fillmore  Ron Cates  Fitch  Lola  OlgerDiekstra  rwoods 
×

Important Information

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