Avatar of João serras-pereira
João serras-pereira
Flag for Portugal

asked on 

aggregate several steps in a calculation

Hi

I have a calculation field that, needs to parse another field.

Currently it runs like this:

I
f ( Middle(mimg_FileName;10;3)="Q9 " ; 
      "documento de identificação frente"  ;
      Case 
      ( 
         Middle(mimg_FileName;14;7) = "FotoMil" ; 
            "fotografia de militante";  
         Middle(mimg_FileName;14;9) = "AssinaMil" ; 
            "assinatura de militante";  
         Middle(mimg_FileName;14;7) = "Canhoto" ; 
            "canhoto";  
         Middle(mimg_FileName;14;12) = "AssinaTestem" ; 
            "assinatura de testemunha";  
         Middle(mimg_FileName;14;10) = "AssinaResp" ; 
            "assinatura de testemunha";  
         Middle(mimg_FileName;10;3) = "Q11" ; 
            "documento de identificação frente";  
         Middle(mimg_FileName;14;11) = "AssinatResp" ; 
            "assinatura de responsável";  
       "--" 
       ) 
   )

Open in new window


Now In need to improve it and make it a bit more complex. The problem I have is that, depending on having previously identified a "Q9", Q10 has 2 meanings, "A" or "B", so the calculation should run like this:

$$type = "" 
if ( Middle(mimg_FileName;10;3)="Q9 " ; 
      ["documento de identificação frente" ;  let $$type =("A")];
      Case 
       ( 
         $$type= "A";
          if (Middle(mimg_FileName;10;3) = "Q10" ;   "documento de identificação frente";  
[indent]    Case 
      ( 
         Middle(mimg_FileName;14;7) = "FotoMil" ; 
            "fotografia de militante";  
         Middle(mimg_FileName;14;9) = "AssinaMil" ; 
            "assinatura de militante";  
         Middle(mimg_FileName;14;7) = "Canhoto" ; 
            "canhoto";  
         Middle(mimg_FileName;14;12) = "AssinaTestem" ; 
            "assinatura de testemunha";  
         Middle(mimg_FileName;14;10) = "AssinaResp" ; 
            "assinatura de testemunha";  
         Middle(mimg_FileName;10;3) = "Q11" ; 
            "documento de identificação frente";  
         Middle(mimg_FileName;14;11) = "AssinatResp" ; 
            "assinatura de responsável";  
       "--" 
       ) [/indent]
   )

Open in new window



Well sort of (needs to be debugged...

Anyway, the question is: is there a manner in a Filemaker calculation to put sevral instructions as a single one?

any help is appreciated
FileMaker Pro

Avatar of undefined
Last Comment
Will Loving

8/22/2022 - Mon