March 4, 201213 yr 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
March 4, 201213 yr 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 )
March 4, 201213 yr 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.
March 5, 201213 yr Author 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 )
March 5, 201213 yr 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
March 5, 201213 yr If the IMAGE_NAME isn't a number, the above calculation wouldn't work. Could you write here some real image names ?
March 5, 201213 yr Author 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" ; )
Create an account or sign in to comment