Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

  • Newbies
Posted

Hi,

I have encountered a big problem in the Case function, that I hope someone has an intelligent solution to... I am start to suspect a bug in the great FM..

I am programming a price enquiry tool for book printing, and needs to set up multiple conditions to get a correct price.

The first Case function is regarding the amount of pages in the book, more or less x number of pages. The result consist of another Case function, which takes the amount of books to be printed into consideration when calculating the price.

So, lets say that the first case function notices that the number of pages is less or equal to 50, then the second case function needs to see what amount of books should be printed and has five conditions to choose from and calculate a result depending on this.

The problem is that the second case function's first two conditions is working perfectly, but the last three conditions is working wrongly..

This is the code:


Case (

Number of pages  ≤  50 ; 

   Case ( 



   Amount of books ≥ 1 and Amount of books ≤ 49 ; Price up to 50 pages and up to 49 copies ; 



   Amount of books ≥ 50 and Amount of books ≤ 99 ; Price up to 50 pages and up to 99 copies ; 



   Amount of books ≥ 100 and Amount of books ≤ 149 ; Price up to 50 pages and up to 149 copies ;



   Amount of books ≥ 150 and Amount of books ≤ 199 ; Price up to 50 pages and up to 199 copies ; 



   Amount of books ≥ 200 ; Price up to 50 pages and over 200 copies ; 



  0 )

... [continueing with other page ranges]

;0 )

This should - according to my expertize... - give me a price for all amount ranges 1-49, 50-99, 100-149, 150-199 and above 200.

But, as said, it functions ok for the two first amount ranges, the third, fourth and fifth range isn't calculated on the specific field with the price (for example the field "Price up to 50 pages and up to 149 copies"), but instead it uses the result 1 field, "Price up to 50 pages and up to 49 copies"...

What is wrong with this code? Can someone tell me, I would very much appreciate it!

With kind regards,

- Johan.

  • Newbies
Posted

I am extremely stupid - I am sorry... The problem, which I noticed after like 4 hours of debugging this was that one of the field was a text field, not a number field... What a shame..

With kind regards,

- Johan.

Posted

This should be done with a price table and lookup, not a calculation.

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