<?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 How to creat a script that generat a Pareto Plot with date filters in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777173#M95838</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hello everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I hope you're doing well.&lt;/SPAN&gt;&lt;SPAN&gt; I'm facing an issue creating a script to generate a Pareto plot from a table that I want to filter by dates (date1 and date2).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As a first step,&lt;/SPAN&gt;&lt;SPAN&gt; I called my table using:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt2 = Open( "/D:/Project JMP/Tables/Table NOK PY.jmp", invisible );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Next :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt2_top5 = dt2 &amp;lt;&amp;lt; Summary(
	Group( :Date, :Ref Produit, :ProductName, :Baie, :ICT_FCT, :CodeError),
	Freq( "Aucun(e)" ),
	Weight( "Aucun(e)" ),
	output table name( "Table2 Top 5" ),
	invisible
);

// Subset of data for Pareto plot filtered by Date
dt_pareto_subset = dt2_top5 &amp;lt;&amp;lt; Select Where( Num( Char( :Date ) ) &amp;gt;= Num( date1 ) &amp;amp; Num( Char( :Date ) ) &amp;lt; Num( date2 ) );
dt_pareto_subset = dt2_top5 &amp;lt;&amp;lt; Subset(
	Selected Rows(1),
	Columns(:CodeError),
	output table name("Pareto Subset"),
	invisible
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and i did creat the Pareto plot in my window&amp;nbsp; :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Border Box(Left(25), Top(50), Bottom(200),
	V List Box(
		// Add the Pareto plot here
		paretoPlot = dt_pareto_subset &amp;lt;&amp;lt; Pareto Plot(
			Y( :CodeError ),
			Freq( "Freq" ),
			Show Percents( 1 ),
			Show Cumulative Line( 1 )
		),
	)	
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but after i lanched my script i did get this error :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Yass_1-1722243762584.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/66572iA1FDD53CD2ABB142/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Yass_1-1722243762584.png" alt="Yass_1-1722243762584.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The script object is expected when accessing or evaluating "Send", dt_pareto_subset &amp;lt;&amp;lt; /*###*/&lt;BR /&gt;Pareto Plot(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Y(:CodeError),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Freq("Freq"),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Show Percents(1),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Show Cumulative Line(1)&lt;/P&gt;&lt;P&gt;)/*###*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a small code snippet that generates a Pareto plot. Currently, I have to manually select the data table each time, and I cannot apply a date filter :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Pareto Plot(
	Cause( :CodeError ),
	SendToReport(
		Dispatch( {"Plots"}, "Pareto Report", FrameBox, {Frame Size( 1555, 725 )} )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Thank you all for your help,&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Yass&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jul 2024 09:15:01 GMT</pubDate>
    <dc:creator>Yass</dc:creator>
    <dc:date>2024-07-29T09:15:01Z</dc:date>
    <item>
      <title>How to creat a script that generat a Pareto Plot with date filters</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777173#M95838</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I hope you're doing well.&lt;/SPAN&gt;&lt;SPAN&gt; I'm facing an issue creating a script to generate a Pareto plot from a table that I want to filter by dates (date1 and date2).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As a first step,&lt;/SPAN&gt;&lt;SPAN&gt; I called my table using:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt2 = Open( "/D:/Project JMP/Tables/Table NOK PY.jmp", invisible );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Next :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt2_top5 = dt2 &amp;lt;&amp;lt; Summary(
	Group( :Date, :Ref Produit, :ProductName, :Baie, :ICT_FCT, :CodeError),
	Freq( "Aucun(e)" ),
	Weight( "Aucun(e)" ),
	output table name( "Table2 Top 5" ),
	invisible
);

// Subset of data for Pareto plot filtered by Date
dt_pareto_subset = dt2_top5 &amp;lt;&amp;lt; Select Where( Num( Char( :Date ) ) &amp;gt;= Num( date1 ) &amp;amp; Num( Char( :Date ) ) &amp;lt; Num( date2 ) );
dt_pareto_subset = dt2_top5 &amp;lt;&amp;lt; Subset(
	Selected Rows(1),
	Columns(:CodeError),
	output table name("Pareto Subset"),
	invisible
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and i did creat the Pareto plot in my window&amp;nbsp; :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Border Box(Left(25), Top(50), Bottom(200),
	V List Box(
		// Add the Pareto plot here
		paretoPlot = dt_pareto_subset &amp;lt;&amp;lt; Pareto Plot(
			Y( :CodeError ),
			Freq( "Freq" ),
			Show Percents( 1 ),
			Show Cumulative Line( 1 )
		),
	)	
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but after i lanched my script i did get this error :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Yass_1-1722243762584.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/66572iA1FDD53CD2ABB142/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Yass_1-1722243762584.png" alt="Yass_1-1722243762584.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The script object is expected when accessing or evaluating "Send", dt_pareto_subset &amp;lt;&amp;lt; /*###*/&lt;BR /&gt;Pareto Plot(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Y(:CodeError),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Freq("Freq"),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Show Percents(1),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Show Cumulative Line(1)&lt;/P&gt;&lt;P&gt;)/*###*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a small code snippet that generates a Pareto plot. Currently, I have to manually select the data table each time, and I cannot apply a date filter :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Pareto Plot(
	Cause( :CodeError ),
	SendToReport(
		Dispatch( {"Plots"}, "Pareto Report", FrameBox, {Frame Size( 1555, 725 )} )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Thank you all for your help,&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Yass&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2024 09:15:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777173#M95838</guid>
      <dc:creator>Yass</dc:creator>
      <dc:date>2024-07-29T09:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat a script that generat a Pareto Plot with date filters</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777185#M95840</link>
      <description>&lt;P&gt;Do you have the subset you expect in dt_pareto_subset? &lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2024 09:26:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777185#M95840</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-29T09:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat a script that generat a Pareto Plot with date filters</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777186#M95841</link>
      <description>&lt;P&gt;yes and i&amp;nbsp;expect dt_pareto_subset to contain only the rows from dt2_top5 where the value in the :Date column falls between date1 and date2&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2024 09:35:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777186#M95841</guid>
      <dc:creator>Yass</dc:creator>
      <dc:date>2024-07-29T09:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat a script that generat a Pareto Plot with date filters</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777187#M95842</link>
      <description>&lt;P&gt;The error message is telling that the variable dt_pareto_subset doesn't have a scriptable object (in this case data table). There could many different causes for this and it is totally guess work without seeing your data or the full script.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2024 09:38:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777187#M95842</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-29T09:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat a script that generat a Pareto Plot with date filters</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777188#M95843</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

TOP5 = New Namespace(
    "TOP5"
);

TOP5:get_dates = Function({},
    ////
);

TOP5:calculate_nok_percentages = Function({dt},
    /////
);

// Define the Do function
TOP5:Do = Function ({nb_date1, nb_date2},
    //Ouverture de la table de données
    dt = Open( "/D:/Project JMP/Tables/TableData PY.jmp", invisible );
    dt2 = Open( "/D:/Project JMP/Tables/Table NOK 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
    );

    dt2_top5 = dt2 &amp;lt;&amp;lt; Summary(
		Group( :Date, :Ref Produit, :ProductName, :Baie, :ICT_FCT, :CodeError),
		Freq( "Aucun(e)" ),
		Weight( "Aucun(e)" ),
		output table name( "Table2 Top 5" ),
		invisible
	);

	// Subset of data for Pareto plot filtered by Date
	dt_pareto_subset = dt2_top5 &amp;lt;&amp;lt; Select Where( Num( Char( :Date ) ) &amp;gt;= Num( date1 ) &amp;amp; Num( Char( :Date ) ) &amp;lt; Num( date2 ) );
	dt_pareto_subset = dt2_top5 &amp;lt;&amp;lt; Subset(
		Selected Rows(1),
		Columns(:CodeError),
		output table name("Pareto Subset"),
		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(
							//nok percent for this month
						),
                    )
                ),
                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
                            )
                        )
                        V List Box(
							//nok percent for this month
						),
                    )
                ),
                
                Border Box(Left(25), Top(50), Bottom(200),
					V List Box(
						// Add the Pareto plot here
						paretoPlot = dt_pareto_subset &amp;lt;&amp;lt; Pareto Plot(
							Y( :CodeError ),
							Freq( "Freq" ),
							Show Percents( 1 ),
							Show Cumulative Line( 1 )
						),
					)	
				)
            )
        )
    );

    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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2024 09:45:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777188#M95843</guid>
      <dc:creator>Yass</dc:creator>
      <dc:date>2024-07-29T09:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat a script that generat a Pareto Plot with date filters</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777189#M95844</link>
      <description>&lt;P&gt;Does it work as intended if you create the plot after you have created the subset? So don't put it inside the new window&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Time Series/Steel Shipments.jmp");

dt &amp;lt;&amp;lt; New Column("Errors", Character, Nominal, Formula(
	Match(Floor(:Steel Shipments / 1000),
		4, "1000",
		5, "2000",
		6, "3000",
		7, "4000",
		8, "5000"
	)
));

rows_of_interest = dt &amp;lt;&amp;lt; Get Rows Where(02Feb1985&amp;lt;= :Date &amp;lt;= 09Jan1990);

dt_subset = dt &amp;lt;&amp;lt; Subset(Rows(rows_of_interest), Selected Columns(0), Output Table("Subset"));

paretoplot = dt_subset &amp;lt;&amp;lt; Pareto Plot(Cause(:Errors));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Jul 2024 10:33:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777189#M95844</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-29T10:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat a script that generat a Pareto Plot with date filters</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777363#M95874</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;i tried the method in your script, it gives me the pareto plot but without data filter. For example the pareto for today must be 2024-07-29 &amp;lt;= :Date &amp;lt; 2024-07-30.&lt;BR /&gt;&lt;BR /&gt;So I used this functions :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Function to get today's and yesterday's date
GetTodayAndYesterday = Function({},
    today = Today();
    yesterday = Date Increment(today, "day", -1, "start");
    evallist({Format(yesterday, "yyyy-mm-dd"), Format(today, "yyyy-mm-dd")});
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	dt = Open( "/D:/Project JMP/Tables/DB.jmp", invisible );&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;    {yesterday, today} = GetTodayAndYesterday();

     dt_top5 = dt &amp;lt;&amp;lt; Summary(
		     Group( :Date, :Ref Produit, :Baie, :ICT_FCT, :Result, :CodeError),
		     Freq( "Aucun(e)" ),
		     Weight( "Aucun(e)" ),
		     output table name( "Table Top 5" ),
		     invisible
	     );&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;    // Create a subset of data for the Pareto Plot filtered by the date range
    rows_of_interest = dt_top5 &amp;lt;&amp;lt; Get Rows Where( Num( Char( :Date ) ) &amp;gt;= Num( yesterday ) &amp;amp; Num( Char( :Date ) ) &amp;lt;= Num( today ) );
    dt_pareto_subset = dt_top5 &amp;lt;&amp;lt; Subset(Rows(rows_of_interest), Selected Columns(0), Output Table("Pareto Subset"), invisible);

    // Generate the Pareto Plot
    paretoplot = dt_pareto_subset &amp;lt;&amp;lt; Pareto Plot(Cause(:CodeError));	&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;I've attached a sample of my database for reference.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 08:12:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777363#M95874</guid>
      <dc:creator>Yass</dc:creator>
      <dc:date>2024-07-30T08:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat a script that generat a Pareto Plot with date filters</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777364#M95875</link>
      <description>&lt;P&gt;Do you want to have a data filter in your pareto plot or do you just want to filter the data? It seems like you just want to create a subset from your data and NOT have a filter.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 08:15:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777364#M95875</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-30T08:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat a script that generat a Pareto Plot with date filters</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777365#M95876</link>
      <description>&lt;P&gt;I need to filter the data with Date using a subset with conditions i need, so i can create a Pareto plot for yesterday's production results because i generate a daily production resalts report every morning.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 08:35:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777365#M95876</guid>
      <dc:creator>Yass</dc:creator>
      <dc:date>2024-07-30T08:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat a script that generat a Pareto Plot with date filters</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777369#M95877</link>
      <description>&lt;P&gt;There should be no need for the num and char to num conversions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe something like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$DOWNLOADS/DB.jmp");

yday = Date Increment(Today(), "day", -1, "start");
tday = Date Increment(Today(), "day", 0, "start");


dt_top5 = dt &amp;lt;&amp;lt; Summary(
	Group(:Date, :Ref Produit, :Baie, :ICT_FCT, :Result, :CodeError),
	Freq("Aucun(e)"),
	Weight("Aucun(e)"),
	output table name("Table Top 5")
);

rows_of_interest = dt_top5 &amp;lt;&amp;lt; Get Rows Where(yday &amp;lt;= :Date &amp;lt;= tday);
show(rows_of_interest);

dt_pareto_subset = dt_top5 &amp;lt;&amp;lt; Subset(
	Rows(rows_of_interest),
	Selected Columns(0),
	Output Table("Pareto Subset")
);

pp = dt_pareto_subset &amp;lt;&amp;lt; Pareto Plot(Cause(:CodeError), Freq(:N Rows));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1722328785073.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/66597i9D67F7DF832D3F8B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1722328785073.png" alt="jthi_1-1722328785073.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also create paretoplot from your initial table (filtering can require a bit of work)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1722328744304.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/66596i55C66DDC9B695562/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1722328744304.png" alt="jthi_0-1722328744304.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; Pareto Plot(
	Cause(:CodeError),
	Local Data Filter(
		Add Filter(
			columns(:Date),
			Where(:Date == 3805056000),
			Display(:Date, N Items(4))
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jul 2024 08:41:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-creat-a-script-that-generat-a-Pareto-Plot-with-date/m-p/777369#M95877</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-30T08:41:06Z</dc:date>
    </item>
  </channel>
</rss>

