Jump to content

running count of self-related records in a table?


seanc

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

Recommended Posts

Hi Everyone,

I'm sure I've done this once before, but I can't for the life of me work out how, so any ideas would be much appreciated.

I have a table with 10 records in it and a self relationship that contains 4 of these records. How can I have a field that shows the sequence number of those related records (ie. 1-4) in alphabetical order (they were entered in random order)?

I can do this easily in a portal, but that won't help me in this case.

Also, I'd like to avoid using a script.

I can set the first related record to 1 easily enough, but thats as far as I can get.

Thanks again,

Sean.

Link to comment
Share on other sites

Create a value list using the self-relationship TO's field that you want to alphabetize, 'starting from' the original table. Then make your sequence number field equal to

Let( V = ValueListItems( Get(FileName); "yourValueList" );

ValueCount(Left( V; Position(

Link to comment
Share on other sites

Hi -Queue-,

Can't think you enough for that smile.gif Works a treat.

Glad I asked, I don't think I would have worked that out.

Having a bit of trouble coming to grips with FP7 and relationships, especially when it comes to value lists...

Thanks again,

Sean.

Link to comment
Share on other sites

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