Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6110 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted (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 by Guest
removed extra semicolon in substitution
Posted (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 by Guest
change the calculation
Posted

Try it now. You dont have to use the Let () statement. It just makes things easier to read.

Posted

Mr. Vodka, my hair is falling down!! :shocked:

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!!!!

Posted

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

     )



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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.