Jorgitopeter Posted April 30, 2008 Posted April 30, 2008 Hi all people! I have 2 simple questions for you: 1)Is there any way to use 2 fuctions into the same calculation field? I mean: Case (......=.....;......=....;....=...)[color:red]; If (.... =.....; ......=....;.....=.....). Which is the operator to join both functions? Semicolons? 2)Is there any function to get only the year, and only the month? I mean, I want to get "April of 2008" Well people, is pretty late here in my country and tomorrow everyone has to wake up early in the morning... so I hope you'll manage to understand my English, and I'll go to sleep. Thanks a lot for everything
The Shadow Posted April 30, 2008 Posted April 30, 2008 1)Is there any way to use 2 fuctions into the same calculation field? Lots of ways, I expect what you might like is &, which appends things together. It all depends on what you want to do with each of the answers to the functions. 2)Is there any function to get only the year, and only the month? I mean, I want to get "April of 2008" Let( [ today=Get(CurrentDate); m = MonthName(today); yr = Year(today) ]; m & " of " & yr ) Hope that helps.
Jorgitopeter Posted April 30, 2008 Author Posted April 30, 2008 Hi Shadow... thanks for the answers... the 2nd one I'll try tomorrow because is too late now... but about the first question... I have calculation like this: Case (CustID ="1"; Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute( Substitute(Substitute(Substitute(Oficios::LetterBody; "<<>>"; (Upper (Órgano))) ; "<<>>"; (Upper ( Dto ) ) ); "<<>>"; (Upper (Fecha de presentacion) ) ); "<<>>"; (Upper ( Apellido) ) ); "<<>>"; (Upper ( Nombre) ) ); "<<>>"; primerio); "<<>>"; nº organo); Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute( Substitute(Oficios::LetterBody; "Tito"; "TimoteIriarte")) [color:red]& Case ( IsEmpty ( nº de órg ); Substitute ( LetterMerge; "Nº"; "" ))... I mean: I want to do all the substitution stuff write in the first "case function", and also check if the field "nº de órg" is empty... in the case of being empty, I want to delete the text chain "Nº" from the field LetterMerge... Am I doing right? Because [color:red]& doesn't seem to work... it erases all the result but a "?" symbol... THANKS FOR HELP MY FRIENDS
Jorgitopeter Posted April 30, 2008 Author Posted April 30, 2008 I tested the 2nd answer and it works great!! Thanks a lot my friend.
mr_vodka Posted April 30, 2008 Posted April 30, 2008 (edited) First you want to use AND not &. Second, I believe that this could be simplified to just: Let ( [ a = Substitute ( Oficios::LetterBody; [ "<<>>"; Upper (Órgano) ]; [ "<<>>"; Upper (Dto) ]; [ "<<>>"; Upper (Fecha de presentacion) ]; [ "<<>>"; Upper (Apellido) ]; [ "<<>>"; Upper ( Nombre) ]; [ "<<>>"; primerio ]; [ "<<>>"; nº organo ] ); b = Substitute ( Oficios::LetterBody; [ "Tito"; "TimoteIriarte" ]; [ "WHATEVER"; "NEW_WHATEVER" ] ); ]; Case ( CustID = 1; a; IsEmpty ( nº de órg ); Substitute ( b; "Nº"; "" ); b ) ) Edited April 30, 2008 by Guest removed extra semicolon in substitution
Jorgitopeter Posted April 30, 2008 Author Posted April 30, 2008 (edited) I'm new with this function 'Let'... what's wrong with it? Becuase FM points me the '(' after 'case'. Thanks for help. Let ( [ a=Substitute ( Oficios::LetterBody; ["<<>>"; Upper (Órga)]; ["<<>>"; Upper (Dto)]; ["<<>>"; Upper (Apellido)] ; ["<<>>"; Upper (Nombre)]; ["<<>>"; nº de órg]; ["<<>>"; Upper (VARIABLE_PARA_MERGER_mesaño)]; ["<<>>"; Fecha de presentacion] ; ["<<>>"; "TOQUI"]; ["<<>>"; "J. DE GANTÍAS" ]; ["<<>>"; "EJMPLO"]; ["<<>>"; "V.E."]; ["<<>>"; "SEÑORES"]); b=Substitute ( Oficios::LetterBody; ["<<>>"; Upper (Órga)]; ["<<>>"; Upper (Dto)]; ["<<>>"; Upper (Apellido)] ; ["<<>>"; Upper (Nombre)]; ["<<>>"; nº de órg]; ["<<>>"; Upper (VARIABLE_PARA_MERGER_mesaño)]; ["<<>>"; Fecha de presentacion] ; ["<<>>"; "TOQUI"]; ["<<>>"; "J. DE GANTÍAS" ]; ["<<>>"; "EJMPLO"]; ["<<>>"; "V.S."]; ["<<>>"; "SEÑORAS"]); c= IsEmpty (nº de órg);substitute (Oficios::LetterBody; "Nº"; ""); Case (Órga = "T.O.C" ; a [color:red]and c; b [color:red]and c)]) Edited April 30, 2008 by Guest change the calculation
mr_vodka Posted April 30, 2008 Posted April 30, 2008 Try it now. You dont have to use the Let () statement. It just makes things easier to read.
Jorgitopeter Posted April 30, 2008 Author Posted April 30, 2008 Mr. Vodka, my hair is falling down!! I had solved the semicolon stuff, but now I added a variable, and it doesn't work any more! Would you mind reading this calculation and tell me what is wrong?? Because I'm sitting here looking at it, and I can't realize what happens... Let ( [ a=Substitute ( Oficios::LetterBody; ["<<> ;>"; Upper (Órga)]; ["<<>>"; Upper (Dto)]; ["<<>>"; Upper (Apellido)] ; ["<<>>"; Upper (Nombre)]; ["<<>>"; nº de órg ]; ["<<>>"; Upper (VARIABLE_PARA_MERGER_mesaño)]; ["<<>>"; Fecha de presentacion] ; ["<<>>"; "TOQUI"]; ["<< >>"; "J. DE GANTÍAS" ]; ["<<> ;>"; "EJMPLO"]; ["<<> ;>"; "V.E."]; ["<<> ;>"; "SEÑORES"]); b=Substitute ( Oficios::LetterBody; ["<<> ;>"; Upper (Órga)]; ["<<>>"; Upper (Dto)]; ["<<>>"; Upper (Apellido)] ; ["<<>>"; Upper (Nombre)]; ["<<>>"; nº de órg judicial]; ["<<>>"; Upper (VARIABLE_PARA_MERGER_mesaño)]; ["<<>>"; Fecha de presentacion] ; ["<<>>"; "TOQUI"]; ["<< >>"; "J. DE GANTÍAS" ]; ["<<> ;>"; "EJMPLO"]; ["<<>>"; "V.S."]; ["<<> ;>"; "SEÑOR"] ); c= IsEmpty (nº de órg); Substitute [color:red](Oficios::LetterBody; "Nº"; "");]; [color:green]FM points me this "(" Case (Órga = "T.O.C" ; a and c; b and c)]) Really really thanks!!!!
mr_vodka Posted April 30, 2008 Posted April 30, 2008 First get rid of the c and its value. Try your case statement this way... Case ( Órga = "T.O.C" and IsEmpty (nº de órg); Substitute (a; "Nº"; ""); Órga = "T.O.C"; a; IsEmpty (nº de órg); Substitute (b; "Nº"; ""); b )
Jorgitopeter Posted May 1, 2008 Author Posted May 1, 2008 Thanks a lot ! You're the best!!! By the way: do you know any FM classes here in Argentina? I want to learn what you know!! : Thanks again for everything.
Recommended Posts
This topic is 6110 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