MacSig Posted February 16, 2015 Posted February 16, 2015 Hello everyone. How can I set the calculated value of field C to the number of records having field A equal to the value inserted to field A and field B equal to the value inserted to field B? For instance with the following situation record 1 => A = "house", B = "pay" record 2 => A = "house", B = "win" record 3 => A = "car", B = "pay" record 4 => A = "house", B = "pay" when I create a new record having A = "house", B = "pay" C should automatically be 2 (since record 1 and 4 have the same A, B. Thanks
comment Posted February 16, 2015 Posted February 16, 2015 Please don't ask abstract questions; more often than not, they lead to the wrong answers. Instead, explain what kind of objects your solution is tracking and what do you need it to do for you. I suspect that once you do that, it will turn out that the real problem here is structural.
MacSig Posted February 17, 2015 Author Posted February 17, 2015 Thank for you reply. Sorry for my question but I feel it is pretty concrete. I have a table called gifts with 3 fields: kind - offer - count Kind and offer may have value from a list the kind list is "house car plane tricycle" the offer list is "pay win lease" I wish to automatically calculate the value of count once selected both kind and offer. Count should be the number of records having the same value of kind and offer. I have tried to achieve so all the afternoon yesterday but even if this it seems to me a very simple thing I cannot figure out how to make it work. Thanks everyone for helping solving my issue.
comment Posted February 17, 2015 Posted February 17, 2015 I am afraid you haven't added anything new. I can answer your question as asked, but I have serious doubts if that's the best way to achieve [whatever this is supposed to achieve]. If you define a self-join relationship of your Gifts table as: Gifts::Kind = Gifts 2::Kind AND Gifts::Offer = Gifts 2::Offer you can then make Count a calculation field (Result is Number, Evaluate from the context of [Gifts]) = Count ( Gifts 2::Kind )
Recommended Posts
This topic is 3834 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 accountSign in
Already have an account? Sign in here.
Sign In Now