rkass068 Posted November 18, 2013 Posted November 18, 2013 Hello I am currently making a database for cancer research in the hospital I work at and I am trying to set a calculation field that will calculate certain regimens of chemotherapy and with summarize them as their generic name. For example, I have a field called "regimen" that is a text box containing the value list: Dex Bortezomib CTX Cisplatin Adriamycin Etoposide Vincristine For the summary field I want it to calculate whats in the regimen field and give me a chemotherapy line For example, Bortezomib + Dex =Velcade Bortezomib + dex + CTX = CyBorD Cisplatin = DHAP etc I know I will have to include the paragraph symbol and I tried using the value count and filter values calculation but I fall into the problem with CyBorD and Velcade since both use Bortezomib and Dex. Thank so much for the help
Fitch Posted November 18, 2013 Posted November 18, 2013 (edited) Case statements evaluate in order, so if you put the CyBorD first that's one problem solved. E.g.: Let([ Dex = Position( regimen ; "Dex" ; 1 ; 1 ) ; Bortezomib = Position( regimen ; "Bortezomib" ; 1 ; 1 ) ; CTX = Position( regimen ; "CTX" ; 1 ; 1 ) ; Cisplatin = Position( regimen ; "Cisplatin" ; 1 ; 1 ) ; // etc result = Case( Bortezomib & Dex & CTX ; "CyBorD" ; Bortezomib & Dex ; "Velcade" ; Cisplatin ; "DHAP" ) ]; result ) Edited November 22, 2013 by Fitch Be sure to fix the calc (replace the "&" with "and") as described below! 1
comment Posted November 18, 2013 Posted November 18, 2013 For the summary field I want it to calculate whats in the regimen field and give me a chemotherapy line For example, Bortezomib + Dex =Velcade Bortezomib + dex + CTX = CyBorD Cisplatin = DHAP It's not quite clear what is the intended result here, since the Regimen field can meet more than one criteria. If you want a single result, you must specify some rules of preference.
comment Posted November 18, 2013 Posted November 18, 2013 Dex = Position( regimen ; "Dex" ; 1 ; 1 ) ; This is not a good test when looking at a return separated list; it's easy to get a false positive when the list contains "Dexomicyl", "Antidexant" or "Curadex". Better use = Dex = not IsEmpty ( FilterValues ( "Dex" ; Regimen ) ) etc. 1
Fitch Posted November 19, 2013 Posted November 19, 2013 I agree -- I did the quick/dirty version, sufficient for the given values, but it's best to future-proof it.
comment Posted November 19, 2013 Posted November 19, 2013 Wait a minute: I now notice something else, too. I might have swallowed the Position() thing, but the real Tom Fitch would not write "&" instead of "and". You must be either an identity thief or a body snatcher.
rkass068 Posted November 19, 2013 Author Posted November 19, 2013 Thank you all for the responses, I will try this out now. However, what I am afraid of is will this allow for any order of the checkboxes to be clicked or will they have to click the boxes in order that is stated in the formula? thanks
Raybaudi Posted November 20, 2013 Posted November 20, 2013 Cruel ? Sanguinary ? ( barbarity, bloodthirstiness, murderousness, truculence, brutishness )
comment Posted November 20, 2013 Posted November 20, 2013 I'm not sure you realize it's a reference to a cultural icon: http://en.wikipedia.org/wiki/Invasion_of_the_Body_Snatchers
Raybaudi Posted November 20, 2013 Posted November 20, 2013 Yes, I didn't realize that because of this: http://thesaurus.com/browse/Body%20Snatcher
Fitch Posted November 20, 2013 Posted November 20, 2013 Thank you all for the responses, I will try this out now. However, what I am afraid of is will this allow for any order of the checkboxes to be clicked or will they have to click the boxes in order that is stated in the formula? thanks Clicked in any order is OK. What's important is the order that each item is evaluated in the Case calculation, because as soon as it hits one that is true, it stops evaluating. Be sure to replace the "&" with "and" in my formula, and even better, use Mr. comment's variation. Those pesky body snatchers...
LaRetta Posted November 20, 2013 Posted November 20, 2013 Happens to me all the time ... every time it seems I make a mistake that's actually when they have snatched my body. It can be a real problem.
rkass068 Posted November 21, 2013 Author Posted November 21, 2013 Clicked in any order is OK. What's important is the order that each item is evaluated in the Case calculation, because as soon as it hits one that is true, it stops evaluating. Be sure to replace the "&" with "and" in my formula, and even better, use Mr. comment's variation. Those pesky body snatchers... Thanks a lot for the advise, it did exactly what you said to do with Mr. Comment's variation and its working perfectly. This is the best FM forum, every time I post something it gets answered perfectly. I will probably have to post another question soon hahaha
Recommended Posts
This topic is 4077 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