Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Hi there.

Could someone help me with a 'simple' math problem (never my strung suit)...

I want to determine the best way to express the ratio between two ever-changing values A & B. Sometimes A >B and sometimes A

I'd like to work it so that the lesser of the two values is shown as "1" in the ratio, thus:

A>B becomes A:1

A

A=B becomes 1:1

Grateful for any help :)-)

How about:

Max ( a ; b ) / Min ( a ; b )

  • Author

Thank you Comment, that was the calculation I was already using to determine what the ratio was, but how to display the result as a ratio.

If

A = 2

B = 1

your calculation returns simply "2"

I'm trying to get it to return (display) "2:1"

and if

A = 1

B = 2

I'm trying to get "1:2"

and if

A = 8

B = 32

I'm trying to get "1:4"

Thanks for your attention :)-)

I think he wants it in ratio format...

A/Min(A;:) & ":" & B/Min(A;:

  • Author

THAT'S what I needed!

Thank you. Thank you. Thank you.

That side of my brain never got past neanderthal, I'm afraid....

That should work, or in a slightly more efficient version:

Let ( denominator = Min ( a ; b ) ; a / denominator & ":" & b / denominator )

  • Author

Thanks again, comment.

Forgive me, but with both formulas, when:

A = 553.00

B = 10.97

return = "1:0"

what am I missunderstanding... please :)-(

Hard to say - I am not able to reproduce this result. Can you post a sample showing this? (A simple file with just three fields would do.)

I don't know how you can get that result unless B is 0 and A is negative.

What are A and B defined as?

  • Author

Here's the calculation producing the 'wrong' ratio:

Let ( denominator = Min ( ALL trades::Total dollars of winners ; ALL trades::Total dollars of losers ) ; ALL trades::Total dollars of winners / denominator & ":" & ALL trades::Total dollars of losers / denominator )

and attached is a file created as requested, where the darn thing works. So I'm doing something wrong in the original...

ratio.fp7.zip

Are those summary fields?

  • Author

No, they're unstored calculation fields.

Well of course, the next question would be what do they calculate, and what's the relationship, but... why don't you examine each component in isolation - i.e. see what

ALL trades::Total dollars of winners

returns on its own, then:

ALL trades::Total dollars of losers

and then:

Min ( ALL trades::Total dollars of winners ; ALL trades::Total dollars of losers )

I am sure somewhere along the way you'll see where it goes wrong.

BTW, the result of calculation should be set to type Text.

  • Author

ALL trades::Total dollars of winners

returns: "$533.00"

ALL trades::Total dollars of losers

returns: "$10.97"

Min ( ALL trades::Total dollars of winners ; ALL trades::Total dollars of losers )

returns: "$10.97"

Let ( denominator = Min ( ALL trades::Total dollars of winners ; ALL trades::Total dollars of losers) ;

ALL trades::Total dollars of winners / denominator & ":" & ALL trades::Total dollars of losers / denominator )

returns: "50.4010207801676996:1"

and yet it should be 48.58:1?

Sigh.

If something returns "$533.00", then it's likely to be a text string, not a number.

EDIT:

But that cannot be the real reason - in your example, Filemaker would convert them to numbers correctly.

Edited by Guest

  • Author

It's definitely a number, but with its "number format" set to $ currency with two decimal places...

I've since removed that formatting, but the result stays the same.

Just to eliminate something - what do you get with:

Let ( [

a = ALL trades::Total dollars of winners ;

b = ALL trades::Total dollars of losers ;

denominator = Min ( a ; b )

] ;

a / denominator & ":" & b / denominator

)

  • Author

I get:

50.4010207801676996:1

What about just winners/losers?

[color:purple]Hey, I'm learning here.

If you think you are the only one, you would be wrong. If you think there are some who aren't learning, you would be correct. But it isn't because they know everything; it's because they close their minds and THINK they know everything.

We ALL are learning here. It is not a sin; it is a blessing. Here's to the journey we ALL are on!! :beertime:

  • Author

What about just winners/losers?

Well, that too returns 50.40102078

Which is nuts.

I'd better call Filemaker and tell them I've got a dodgy copy... :)-(

  • Author

Sometimes, stuck here in this room on my own, day after day, I feel like the only one who's EVER struggled with this program... :)-)

What about (in a text field) winners & " " & losers & " " & winners/losers?

  • Author

What about (in a text field) winners & " " & losers & " " & winners/losers?

OK, that returns a crazy

55310.97250.4010207801676996

?

Something doesn't fit here. I suspect your first test wasn't done correctly. Please go into the SAME calculation field where the entire formula lives, and change it to:

Let ( [

a = ALL trades::Total dollars of winners ;

b = ALL trades::Total dollars of losers ;

denominator = Min ( a ; b )

] ;

a

)

Note the result, then change the formula to:

Let ( [

a = ALL trades::Total dollars of winners ;

b = ALL trades::Total dollars of losers ;

denominator = Min ( a ; b )

] ;

b

)

and finally:

Let ( [

a = ALL trades::Total dollars of winners ;

b = ALL trades::Total dollars of losers ;

denominator = Min ( a ; b )

] ;

denominator

)

Please report these three results.

  • Author

I'm going to go back and rebuild the dependancies that lead me to A & B, 'cos obviously something's not right at this end and I don't want to keep wasting your time with my inane floundering around.

I'll be back...

Are you aware of the fact that a reference to a related field returns the value from the FIRST related record?

Why not give Comment what he has asked? He has taken the time to request it to help you? He can probably give you the answer right now!

He can probably give you the answer right now!

LOL, don't make promises I'd have to keep. The truth is I have no idea what's going on here, only a vague suspicion.

I don't care. You gave three tests!! Those tests will probably provide answers!! How difficult is it to simply follow instructions? Much simpler than taking something back home and re-hashing, re-thinking, re-doing the darned thing, no? What is to lose?

Why has Winners gone from 553 to 533?

What is to lose? The sense of excitement of figuring it on your own, the learning experience ... I'd think you would be the first one to understand that: "The Journey's the Thing!!"

I totally agree. I find that when I run into a serious problem that takes me awhile to solve. It is that much more gratifying to get it working. Also what was causing it seems to stick in my head more....lol.

The OP will prob post tomorrow "YAY I figured it out" :)

Michael.

  • Author

As soon as I posted that, we suffered a 2hr neighborhood power outtage... I had every intention of performing the three "tasks" AND trying to work backwards to see where the error lies at my end.

How difficult is it to simply follow instructions?

Have I not been polite enough? I thought I had.

Edited by Guest

How difficult is it to simply follow instructions?

It was not my intent to be rude! It's just that I see many people on Forums ask for help and then give up too soon. All the while, someone here has spent time coming up with a solution (or really putting time into helping them solve it) and the answer is right here if they would have stuck it out one more moment.

I thought you were leaving and I was trying to QUICKLY say, "Hey wait! We may have something which will help you solve it." And Comment has listed the steps out very specifically and it should give some inkling as to the problem.

Yes. I know the power of solving things myself. But I also know how it feels when one has solved something and placed it before someone here ... only to have them say (usally without even looking at it), "well, I trashed it and I don't care what the answer is."

True, either way, I win ... because *I* learned from the experience. But unless I help the other person who has ASKED for help, something feels lacking. If the OP would have wanted to figure it all out themselves, they wouldn't have posted in the first place. So yes, I understand working through things. And I also understand that, when I ask for help, it's because I usually want help.

So, fiveshorts, please accept my apology for my tone. I was only trying to help you quickly before you left. :crazy2:

Edited by Guest
Changed some wording

  • Author

It's OK. This texting business is very harsh when it comes to tone... I try to express my gratitude for people's attention to my requests for help — particularly yourself, DJ, comment — as I know I'm asking a favor. If anything, I exaggerate my manners, so you KNOW I'm not just a lazy exploiter of your generosity.

But with this particular request, it became more and more obvious that the problem lay at a fundamental level with my source data and not with the advice I was being given. As it turns out (and as was being predicted), a eureka moment has occurred this morning as I worked back through the problem with a fresh head.

Deep in the calculation trail was a reference to a value I'd created to be used on the presentation layer that transformed a negative to a positive. Once I'd bypassed that, the formulas that everyone had so kindly and quickly provided at outset worked fine.

So, once again, as a person who regularly helps others on other forums (where I'm considered a DJ or a comment or a LaRetta in my own right — I'm a film composer by trade), I truly appreciate it when people give their time to help my floundering about with FM. It's far from being my primary discipline, and I don't have the opportunity or commissions (or the right type of brain) to become a virtuoso.

So: problem solved. the replies you all gave got me there. And I thank you one and all.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.