kungx Posted March 4, 2012 Posted March 4, 2012 Hi Everyone, I am trying get the ABCD to work. Is there any way to categorize the "0" to read any letter instead of a number? Part number ex: is SR18.1111 (yes this is a real image name). Case ( IMAGE_NAME ≥ 6000 ; 6000; IMAGE_NAME ≥ 5000 ; 5000; IMAGE_NAME ≥ 4000 ; 4000; IMAGE_NAME ≥ 3000 ; 3000; IMAGE_NAME ≥ 2000 ; 2000; IMAGE_NAME ≥ 1000 ; 1000; IMAGE_NAME ≤ 999 ; "0000"; IMAGE_NAME ≤ 0 ; "ABCD"; ) EX: if it's a part number under 999 then the directory should be 0000 but if it's over 1000 but under 2000 then it should be 1000. etc 2filemaker.zip
Raybaudi Posted March 4, 2012 Posted March 4, 2012 You'll have to revert the case..., something like: Case( IMAGE_NAME ≥ 6000 ; 6000 ; IMAGE_NAME ≥ 5000 ; 5000 ; ... "0000" ) But there is a better way..., something like: Left ( Floor ( IMAGE_NAME / 1000 ) & "0000" ; 4 )
comment Posted March 4, 2012 Posted March 4, 2012 Note also that if IMAGE_NAME is Text, then the comparison IMAGE_NAME < 999 is done alphabetically, i.e. = IMAGE_NAME < "999" and in such circumstances only IMAGE_NAMEs that begin with "999" and continue will be greater.
kungx Posted March 5, 2012 Author Posted March 5, 2012 Hey that works!!! Thanks, but how about what if it's not a number but just a random letter for instance like a item names SR11.1111 but I want to put it in a category of ABCD? How does something like that work? I was trying to figure it out in the last few hours but nothing yet. You'll have to revert the case..., something like: Case( IMAGE_NAME ≥ 6000 ; 6000 ; IMAGE_NAME ≥ 5000 ; 5000 ; ... "0000" ) But there is a better way..., something like: Left ( Floor ( IMAGE_NAME / 1000 ) & "0000" ; 4 ) You'll have to revert the case..., something like: Case( IMAGE_NAME ≥ 6000 ; 6000 ; IMAGE_NAME ≥ 5000 ; 5000 ; ... "0000" ) But there is a better way..., something like: Left ( Floor ( IMAGE_NAME / 1000 ) & "0000" ; 4 )
Lee Smith Posted March 5, 2012 Posted March 5, 2012 Automatic message This topic has been moved from "FileMaker Product Family → FileMaker Pro 9" to "Database Schema & Business Logic → Calculation Engine (Define Fields)". The General topic areas are intended for the discussion of the functions, features and tools that were new when that particular version was Released. All how-to question should be posted to a topic area that best matches the sprit of your question. Many questions can fit into more then one area, but you only need to pick one f them, and go with it. If you have any questions about this action, please contact me through a private message. Lee
Raybaudi Posted March 5, 2012 Posted March 5, 2012 If the IMAGE_NAME isn't a number, the above calculation wouldn't work. Could you write here some real image names ?
kungx Posted March 5, 2012 Author Posted March 5, 2012 Alright it was simple the code is now which works great!! It seems any letter is bigger than a number so if the part number is even A or SR18-1111 then uses a ABCD category. Case ( IMAGE_NAME ≥ 99999; "ABCD"; IMAGE_NAME ≥ 6000; "6000"; IMAGE_NAME ≥ 5000; "5000"; IMAGE_NAME ≥ 4000; "4000"; IMAGE_NAME ≥ 3000; "3000"; IMAGE_NAME ≥ 2000; "2000"; IMAGE_NAME ≥ 1000; "1000"; IMAGE_NAME ≤ 999 ; "0000" ; )
Recommended Posts
This topic is 4914 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