Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

2 functions in the same calculation

Featured Replies

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

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.

  • 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

  • Author

I tested the 2nd answer and it works great!! Thanks a lot my friend.

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

  • 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 by Guest
change the calculation

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

  • Author

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

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

     )



  • 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

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.