April 30, 200817 yr 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
April 30, 200817 yr 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.
April 30, 200817 yr Author 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
April 30, 200817 yr 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, 200817 yr by Guest removed extra semicolon in substitution
April 30, 200817 yr Author 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, 200817 yr by Guest change the calculation
April 30, 200817 yr Try it now. You dont have to use the Let () statement. It just makes things easier to read.
April 30, 200817 yr Author 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!!!!
April 30, 200817 yr 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 )
May 1, 200817 yr Author 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.
Create an account or sign in to comment