Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

List unique records


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

Recommended Posts

Hi all,

I have 2 tables..

StockCodes

CreateFile

In CreateFile, I have a field called List.

At the moment, this is a calculated list that lists all records (stock codes) from the table StockCodes.

So the list shows

StockCode1

StockCode2

StockCode3

...

Does anyone know a way whereby this list will only show the unique records from the StockCodes table.

In other words the stockcodes table may show a stock item code in more than 1 record. I would like the list to only show the stock item codes that are listed in 1 record only in that table.

Can any of you experts out there advise on the best way to do this please?

Many thanks

Ed

Link to comment
Share on other sites

Thanks bcooney. I will take a look at the custom function and see if I can use that. I think I will be able to.

The structure is as follows:

Table: HistoricData

Field1: StockCode

Field2: Date

Field3: Amount

Filed4: RelationSetup

Table: CreateFile

Field1: Text (List field)

Field2: RelationSetup

I am sure this is not "proper" but it works...

The relationship is basically rubbish. All records from HistoricData relate to the 1 and only record in CreateFile by the 2 RelationSetup fields.

I can see experts cringing!!

Anyway, this provides the list in CreateFile - a list of all stockcodes from the related records (all of them) in HistoricData.

I want the list to show only the records that are unique - so where there is only one instance of the stock code in Historic Data.

For info, if it matters, the field called Text in the 2nd table is not just a list - it also has static text around the list so...

Here are the stock codes with only 1 record

Stock1

Stock2

Stock3

Sort them out...

Could I use the custom function using my "fake" relationship?

Thanks again - of course open to any suggestions on how to do this better!! Always eager to learn the "proper" way of doing things.

Ed

Link to comment
Share on other sites

Its quite a strange scenario really.

The data in the historic table is submitted every Friday from Excel spreadsheets - something I can't get the users away from - this is using ODBC.

Now each Friday night I need to check if there have been any new stock items added to the historic table - i.e. it is the items first record.

If it is I create an output text file (the Field: Text mentioned in the previous post) which is submitted to an external system which then generates the old data I need.

I know, not pretty but with what I've bene given it is what I need to do.

Thanks

Link to comment
Share on other sites

I am sorry, but I still don't get this. Unique is unique, and new is new. If I have a list:

A

B

A

C

A

then unique is:

A

B

C

If I now add to the list, so that it becomes:

A

B

A

C

A

D

D

A

then unique is now:

A

B

C

D

and new is:

D

So which one do you need?

Link to comment
Share on other sites

Come to think of it, there is a much simpler (and faster) way to find records that do not have duplicates:) enter Find mode, type ! (exclamation mark) into the StockCode field, check the Omit box and perform a find.

I should have come up with this at once, but I guess I got all confused by the term "unique".

:doah:

I still don't get what role "old" and "new" play in this; perhaps you need only to constrain the found set instead of doing a full find?

Link to comment
Share on other sites

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