<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: The evaluation of the symbol is too recursive (&amp;gt;250 levels) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/The-evaluation-of-the-symbol-is-too-recursive-gt-250-levels/m-p/774784#M95680</link>
    <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp; it works !!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jul 2024 12:11:49 GMT</pubDate>
    <dc:creator>Yass</dc:creator>
    <dc:date>2024-07-23T12:11:49Z</dc:date>
    <item>
      <title>The evaluation of the symbol is too recursive (&gt;250 levels)</title>
      <link>https://community.jmp.com/t5/Discussions/The-evaluation-of-the-symbol-is-too-recursive-gt-250-levels/m-p/774760#M95674</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a problem with a script that generates a daily report of production results. I added a part that calculates "&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;TOP5:calculate_nok_percentages&lt;/SPAN&gt;&lt;SPAN&gt;".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is not the first time I've asked about this. the previous time it was in a different context, and it worked until today. However, when I tried to do the same for the daily report, I received this error message:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JMP16&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;JMP Alert

Error: The evaluation of the symbol is too recursive (&amp;gt;250 levels). During access or evaluation of&amp;nbsp;percent_nok_ict, percent_nok_ict

A stack overflow has been detected. The maximum number of call levels has been exceeded. Execution has been terminated.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Scripts :&lt;BR /&gt;&lt;BR /&gt;&lt;U&gt;Lancher_Daily_Result :&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;taskkill /f /im jmp.exe
"C:\Program Files\SAS\JMP\16\jmp.exe" "D:\Project JMP\Scripts\TOP5_week.jsl"
echo Fin TOP5_week %time% &amp;gt;log.txt&lt;/PRE&gt;&lt;U&gt;TOP5_week.jsl :&lt;/U&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here (1);

Include("D:\Project JMP\Scripts\TOP5.jsl");

TOP5:Do(-1, -0);&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;U&gt;TOP5.jsl:&lt;/U&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

TOP5 = New Namespace(
    "TOP5"
);

TOP5:get_dates = Function({},
    today_date = Format(Today(), "yyyy-mm-dd");
    start_of_month = Format(Date Increment(Today(), "Month", 0, "Start"), "yyyy-mm-dd");
    evallist({start_of_month, today_date});
);

TOP5:calculate_nok_percentages = Function({dt},
    {start_of_month, today_date} = TOP5:get_dates();

    dt_top5 = dt &amp;lt;&amp;lt; Summary(
        Group(:Date, :Nom de fichier, :Ref Produit, :ProductName, :Baie, :ICT_FCT, :Result, :Reason Error, :CodeError),
        Freq("Aucun(e)"),
        Weight("Aucun(e)"),
        invisible
    );

    nameFilesNok = Associative Array(Column(dt_top5, "Nom de fichier") &amp;lt;&amp;lt; Get Values) &amp;lt;&amp;lt; Get Keys;

    total_nb_total_ict = 0;
    total_nb_total_fct = 0;
    total_nb_nok_ict = 0;
    total_nb_nok_fct = 0;

    For(k = 1, k &amp;lt;= N Items(nameFilesNok), k++,
        FileRows = dt_top5 &amp;lt;&amp;lt; get rows where(
            :File Name == nameFilesNok[k] &amp;amp; Num(Char(:Date)) &amp;gt;= Num(start_of_month) &amp;amp; Num(Char(:Date)) &amp;lt;= Num(today_date) &amp;amp; Contains(:File Name, "GOLDEN") == 0
        );

        nb_total_ict = 0;
        nb_total_fct = 0;
        nb_nok_ict = 0;
        nb_nok_fct = 0;

        total_rows = N Items(FileRows);

        For(j = 1, j &amp;lt;= total_rows, j++,
            If(dt_top5:ICT_FCT[FileRows[j]] == "ICT",
                nb_total_ict = nb_total_ict + dt_top5:Nb. de lignes[FileRows[j]];
                If(dt_top5:Result[FileRows[j]] == "NOK",
                    nb_nok_ict = nb_nok_ict + dt_top5:Nb. de lignes[FileRows[j]]
                );
            , dt_top5:ICT_FCT[FileRows[j]] == "FCT",
                nb_total_fct = nb_total_fct + dt_top5:Nb. de lignes[FileRows[j]];
                If(dt_top5:Result[FileRows[j]] == "NOK",
                    nb_nok_fct = nb_nok_fct + dt_top5:Nb. de lignes[FileRows[j]]
                );
            )
        );

        total_nb_total_ict += nb_total_ict;
        total_nb_total_fct += nb_total_fct;
        total_nb_nok_ict += nb_nok_ict;
        total_nb_nok_fct += nb_nok_fct;
    );

    percent_nok_ict = (total_nb_nok_ict / total_nb_total_ict) * 100;
    percent_nok_fct = (total_nb_nok_fct / total_nb_total_fct) * 100;

    Return({percent_nok_ict, percent_nok_fct});
);

// Define the Do function
TOP5:Do = Function ({nb_date1, nb_date2},
    //Ouverture de la table de données
    dt = Open( "/D:/Project JMP/Tables Données/SVI/TableData SVI PY.jmp", invisible );

    {percent_nok_ict, percent_nok_fct} = TOP5:calculate_nok_percentages(dt);

    current_month = Format(Today(), "Format Pattern", "&amp;lt;Month&amp;gt;", &amp;lt;&amp;lt; Use Locale(0));

    date1 = Date Increment(Today(), "day", nb_date1, "start");
    date2 = Date Increment(Today(), "day", nb_date2, "start");

    dt_top5 = dt &amp;lt;&amp;lt; Summary(
        Group( :Date, :Nom de fichier, :Ref Produit, :ProductName, :Baie, :ICT_FCT, :Result, :CodeError),
        Freq( "Aucun(e)" ),
        Weight( "Aucun(e)" ),
        output table name( "Table Top 5" ),
        invisible
    );

    /*
    //
    //
    //

    Here i have the logic of production repport.
    it's fine it works 
    
    //
    //
    //
    */


    //Création de la fenetre du top 5
    window = new Window ("TOP5",
        V List Box(
            pb = Picture Box( Open( "D:\Project JMP\Images\logo.png", png ) ),
            Border Box( Top(50),
                V List Box(
                    tb1 = Text Box("Production results report of "||Format( date2, "yyyy-mm-dd" )),
                    tb1 &amp;lt;&amp;lt; Set Base Font( "Title" ),
                    tb1 &amp;lt;&amp;lt; Set Font Scale (3),
                    tb1 &amp;lt;&amp;lt; Justify Text("Center"),
                    tb1 &amp;lt;&amp;lt; Set Width(2770),
                    tb1 &amp;lt;&amp;lt; Background Color(RGB Color(225, 225, 225)),
                    
                    tb2 = Text Box ("SVI, PY"),
                    tb2 &amp;lt;&amp;lt; Justify Text("Center") &amp;lt;&amp;lt; Set Font Size(25),
                    tb2 &amp;lt;&amp;lt; Set Width(2770),
                    tb2 &amp;lt;&amp;lt; Background Color(RGB Color(240, 240, 240)),
                )
            ),
            V List Box (
                Border Box (Top (100), Bottom(100), Left (25),
                    H List Box(
                        // TOP 5 ICT
                        V List Box(
                            tb3 = Text Box( "Top 5 NOK results for ICT"),
                            tb3 &amp;lt;&amp;lt; Set Base Font( "Title" ),
                            tb3 &amp;lt;&amp;lt; Set Font Scale (2),
                            H List Box(
                                // column bay
                                
                                // column product ref
                                
                                // column test number
                                
                                //column %nok
                                
                                // column product name
                            )
                        ),	
                        V List Box(
                            Border Box(Top(100), Bottom(100), Left(200), Right(25),
                                V List Box(
                                    nokPercentTitle = Text Box("%Nok Percent for this month"),
                                    nokPercentTitle &amp;lt;&amp;lt; Set Base Font("Title"),
                                    nokPercentTitle &amp;lt;&amp;lt; Set Font Scale(2),
                                    nokPercentTitle &amp;lt;&amp;lt; Justify Text("Center"),
                                    nokPercentTitle &amp;lt;&amp;lt; Set Width(750),

                                    Border Box(Left(10), Right(10), Top(10), Bottom(10), Sides(15),
                                        b1 = Border Box(Left(l), Right(r), Top(t), Bottom(b), Sides(s), t1 = Text Box("ICT Nok Percent for " || current_month || " is :" || Char(Round(percent_nok_ict)) || "%" )), 
                                        b1 &amp;lt;&amp;lt; Set Background Color(RGB Color(93, 173, 226)),
                                        t1 &amp;lt;&amp;lt; Set Width(750) &amp;lt;&amp;lt; Set Font Size(25) &amp;lt;&amp;lt; Justify Text("Center")
                                    ),

                                    Border Box(Left(10), Right(10), Top(10), Bottom(10), Sides(15),
                                        b2 = Border Box(Left(l), Right(r), Top(t), Bottom(b), Sides(s), t2 = Text Box("FCT Nok Percent for " || current_month || " is :" || Char(Round(percent_nok_fct)) || "%" )), 
                                        b2 &amp;lt;&amp;lt; Set Background Color(RGB Color(245, 176, 65)),
                                        t2 &amp;lt;&amp;lt; Set Width(750) &amp;lt;&amp;lt; Set Font Size(25) &amp;lt;&amp;lt; Justify Text("Center")
                                    )
                                )
                            )
                        ),
                    )
                ),
                Border Box(Left(25), Top(50), Bottom(200),
                    //TOP 5 FCT
                    V List Box(
                        tb4 = Text Box( "Top 5 NOK results for FCT"),
                        tb4 &amp;lt;&amp;lt; Set Base Font( "Title" ),
                        tb4 &amp;lt;&amp;lt; Set Font Scale (2),
                        H List Box(
                                // column bay
                                
                                // column product ref
                                
                                // column test number
                                
                                //column %nok
                                
                                // column product name
                            )
                    )
                )
            )
        )
    );

    window &amp;lt;&amp;lt; Maximize Window (1);
    //Enregistrement du fichier image .png et du fichier texte .txt
    window &amp;lt;&amp;lt; Save Picture ("D:\Project JMP\Rapports de Production Quotidiens\Rapport du "||Format( date2, "yyyy-mm-dd" )||".png", "png");
    window &amp;lt;&amp;lt; Save Text ("D:\Project JMP\Rapports de Production Quotidiens\Rapport du "||Format( date2, "yyyy-mm-dd" )||".txt");
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;Thank you for your help !&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 23 Jul 2024 08:59:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/The-evaluation-of-the-symbol-is-too-recursive-gt-250-levels/m-p/774760#M95674</guid>
      <dc:creator>Yass</dc:creator>
      <dc:date>2024-07-23T08:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: The evaluation of the symbol is too recursive (&gt;250 levels)</title>
      <link>https://community.jmp.com/t5/Discussions/The-evaluation-of-the-symbol-is-too-recursive-gt-250-levels/m-p/774775#M95677</link>
      <description>&lt;P&gt;Try adding Eval List to&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Return({percent_nok_ict, percent_nok_fct});&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;so&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Return(Eval List({percent_nok_ict, percent_nok_fct}));&lt;/LI-CODE&gt;
&lt;P&gt;I would also suggest you try to handle local variables in your functions either by listing them or by using Default Local to avoid possible issues (or detect issues earlier) ,&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/en/18.0/#page/jmp/advanced-functions.shtml#" target="_blank"&gt;Advanced Functions (jmp.com)&lt;/A&gt;&amp;nbsp;- Local Symbols&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 11:02:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/The-evaluation-of-the-symbol-is-too-recursive-gt-250-levels/m-p/774775#M95677</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-23T11:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: The evaluation of the symbol is too recursive (&gt;250 levels)</title>
      <link>https://community.jmp.com/t5/Discussions/The-evaluation-of-the-symbol-is-too-recursive-gt-250-levels/m-p/774784#M95680</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp; it works !!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 12:11:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/The-evaluation-of-the-symbol-is-too-recursive-gt-250-levels/m-p/774784#M95680</guid>
      <dc:creator>Yass</dc:creator>
      <dc:date>2024-07-23T12:11:49Z</dc:date>
    </item>
  </channel>
</rss>

