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 6201 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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 :)-)

Posted

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 :)-)

Posted

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

Posted

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.

Posted

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.

Posted (edited)

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
Posted

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.

Posted

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

)

Posted

[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:

Posted

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.

Posted

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...

Posted

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!

Posted

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.

Posted

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?

Posted

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!!"

Posted

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.

Posted (edited)

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
Posted (edited)

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

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