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

Getting portal row number for a calc.


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

Recommended Posts

Posted

Hi All,

I have a table of students. To group those from the same family I use a self-join relationship based on surname & home phone and display them in a portal. Both the relationship and the portal are sorted by student contact hours, descending.

I need to calculate a family discount rate so that if the student falls into the top row of the portal, they calc as 1, otherwise as 0.9

Since there seems to be no First() function, I changed the relationship & portal sorts to descending and used

If(

Last(MyFamilyMembers::NameFull) = NameFull;

1;.9

)

My flawed logic: "If I am at the person at the bottom of the list, give me a 1, otherwise give me a 0.9"

All family members end up with a "1" .

Any suggestions

Posted

The same occurrence as the layout containing the portal.

Attached are some screen shots in case that makes it clearer.

Read 'Gymnasts' as 'Students'.

Thanks, Phil

Studentfamily.zip

Posted

I need to calculate a family discount rate so that if the student falls into the top row of the portal, they calc as 1, otherwise as 0.9

Since there seems to be no First() function, I changed the relationship & portal sorts to descending and used

If(

Last(MyFamilyMembers::NameFull) = NameFull;

1;.9

)

My flawed logic: "If I am at the person at the bottom of the list, give me a 1, otherwise give me a 0.9"

All family members end up with a "1" .

It's a work around for something that actually has an easy answer.

You're right, there is no First() function. But if you simply reference the field itself, the "top row of the portal" is returned (assuming the portal is sorted the same way as the relationship, or not at all).

The First() function for related reocrds is to simply not use a function at all.

Posted

OK so I tried this;

If(

MyFamilyMembers::NameFull = NameFull;

1;.9

)

But the calc. still returns a "1" for everyone.

Posted

That would be great if you could have a look. It was a huge file so it's taken a while to empty it.

Use acct name: ph

password:1234

The calc field is the last one in the Gymnasts Table 'Family Rank'

The family members portal is on the layout 'GymnastDetail'

Many thanks, Phil

Gym.fp7.zip

Posted

The calculation returns the correct result. However, the field is formatted to display as decimal with 0 decimal digits - which makes a result of 0.9 APPEAR as 1.

Posted

AAAAAHHHHHHHH!!

Thank you everybody!

The answer is always hiding in there somewhere!

Regards, Phil

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