Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Problems with look ups


Joe90
 Share

Recommended Posts

I am looking up info in summary fields and instead of getting the info from a found set of records I am getting the info from all records in the related database.

 

Example database1 has a

field CarMake

and a Summary field Total Number of CarMake

 

If I have a 1000 records in this database

 

I search for Ford in CarMake and I get 122

When I do tyhe lookup I import 1000 instead of 122

Link to comment
Share on other sites

Yeah, summary fields aren't very useful as a source for a Lookup.

 

Usually this type of thing is done by filtering the relationship between the two tables by whatever your criteria is, and then using an aggregate function, like Sum() or Count() to total the related values.

Link to comment
Share on other sites

Thanks for the info I am importing the found set of data into a holding file and then into wy final database this is working but seems long winded has anyone got any better ideas

Link to comment
Share on other sites

Thanks for the info I am importing the found set of data into a holding file and then into wy final database this is working but seems long winded has anyone got any better ideas

Why are you importing the data to a holding file? What's the trouble with using relationships?

Link to comment
Share on other sites

What Ender said. You're going about this wrong.

 

Example database1 has a field CarMake

 

That part's good. Now if you want to know the sum total of all records where CarMake = and have it appear in a field, you can

 

Define a relationship between the field into which you typed "Ford" and the field CarMake, which will create a table occurrence; define a number constant, "One" defined as =1; define a calc field, TotalSelectedCarMake, = Sum(ThatTableOccurrence::One); and put TotalSelectedCarMake on your layout where you want to see the total.

 

If, instead, you want the total of all records in the current found set where CarMake = , but your current found set doesn't necessarily consist of all records where CarMake="Ford", you can:

 

Define a global field g.CarMakeChoice, which is where you will enter your choice, in this case "Ford"; define a numerical calc field, One_ifCarMake, = Case(CarMake=g.CarMakeChoice, 1); and define a Summary field, defined as the total of One_ifCarMake.

 

If, instead, you always expect to do a Find in the CarMake field for , so the found set will consist of all records where CarMake is what you're interested in, and you just want a field on the layout reflecting the total number of records, all you need to do is:

 

Define a calc field, unstored, numerical, = Get(FoundCount). There ya go.

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

Terms of Use