MsqedMan Posted September 22, 2006 Share Posted September 22, 2006 I am trying to do an autofill field with a calculation that I just can't seem to fight my way through. I have a field "Frequency" and want to calculate the field "TV Channel" I have all the numbers, but can't come up with the syntax. The calculation is mostly "if is >10 but <19.9, then "1", and "if is >20 but <20.9, then "2". But i have to repeat the if/then statement 69 times, as there are 69 possible TV Channels. Any help on where to start this would be greatly appreciated! Thank you. Link to comment Share on other sites More sharing options...
Raybaudi Posted September 22, 2006 Share Posted September 22, 2006 Hi this simple calc: Div ( Frequency ; 10 ) gives you: 1 when frequency is ≥ 10 but < 20 2 when frequency is ≥ 20 but < 30 and so on... Link to comment Share on other sites More sharing options...
LaRetta Posted September 22, 2006 Share Posted September 22, 2006 It doesn't quite work out, Daniele ... < 20.9 ... 20.9 produces 2. It may be mistype - your logic works out - but we can only go by what is given us in the post. When MsqedMan says, "The calculation is [color:green]mostly "if is >", that may mean there are exceptions. With 69 channels, a simple Channel lookup table might be a better option. Link to comment Share on other sites More sharing options...
Raybaudi Posted September 22, 2006 Share Posted September 22, 2006 Hi LaRetta I assumed that MsqedMan has forgotten some values...and that 20,9 was a typo of 29,9. Where is 20 ? Where is 30 ? Where are values from 29,9 to 30 ? So, till he doesn't give us better specifications, the calc can be: Case( frequency = Int ( frequency );"we don't know"; Mod ( frequency; 10 ) ≥ 9,9;"we don't know too"; Div ( frequency ; 10 ) ) Link to comment Share on other sites More sharing options...
MsqedMan Posted September 22, 2006 Author Share Posted September 22, 2006 Thanks for the help so far, and as I re read my post, I realized it didn't make much sense. I have attached a file that has the TV Channel numbers and info. what I am trying to do in another database is to be able to enter in a random frequency, and have the TV channel field come back with the TV Channel. So, the calculation I'm trying to do is to see if "Frequency" falls in the range stated by "Band.Low" and "Band.High". I would also like a flag to tell me if I entered a frequency that was very close to the "Audio Carrier", "Chroma Carrier", or "Video Carrier". Again, thank you for the help. Tony RFStuff.fp7.zip Link to comment Share on other sites More sharing options...
Raybaudi Posted September 22, 2006 Share Posted September 22, 2006 Ok. Try this. RFStuffrev1.zip Link to comment Share on other sites More sharing options...
MsqedMan Posted September 23, 2006 Author Share Posted September 23, 2006 I never thought to do this with a relationship. This works great. In my layout I could put a portal showing me the tv channel information. How would I continue this, though, to raise a flag if I choose a carrier frequency? Would I continue to use relationships or would that be a validation? This is the gritty part of FMP that I am not very clear on. Thank you for the help so far!!! Tony Link to comment Share on other sites More sharing options...
Raybaudi Posted September 23, 2006 Share Posted September 23, 2006 How would I continue this, though, to raise a flag if I choose a carrier frequency? Would I continue to use relationships or would that be a validation? Hi Tony sorry but my english isn't so good... can you repeat your request with other words ? Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6552 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