<?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: cumulative of only new item (exclude repeated) by weekly in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/cumulative-of-only-new-item-exclude-repeated-by-weekly/m-p/593486#M79736</link>
    <description>&lt;P&gt;Hi Jim&lt;/P&gt;&lt;P&gt;Thanks, is there shorter way to get to the graph? Or I have no choice must go through the steps?&lt;/P&gt;&lt;P&gt;I will have a very large data that is from daily for months and concern of if these steps are the method to deliver the output later.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jan 2023 12:45:50 GMT</pubDate>
    <dc:creator>dadawasozo</dc:creator>
    <dc:date>2023-01-26T12:45:50Z</dc:date>
    <item>
      <title>cumulative of only new item (exclude repeated) by weekly</title>
      <link>https://community.jmp.com/t5/Discussions/cumulative-of-only-new-item-exclude-repeated-by-weekly/m-p/593308#M79718</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to build a graph that will show cumulative of only new items by week from a table that has 2 columns (see attached as example). In the table, there are 91 different type of fruits that link to the date which is from 01/02/2024 - 9/29/2024. Below is the desired graph. The steps so far I took to get the graph seems not too effective/efficient. I wonder if anyone has more effective (JSL) way to do it?&lt;/P&gt;&lt;P&gt;Steps I used to generate the graph:&lt;/P&gt;&lt;P&gt;1) create a column in the same table with Formula(Week Of Year(:Date)).&lt;/P&gt;&lt;P&gt;2) summarize table N(Fruit) by Fruit and WW&lt;/P&gt;&lt;P&gt;3) in summary table of 2) , add a column (Count of WW) with Formula(Col Min(:WW, :Fruit))&lt;/P&gt;&lt;P&gt;4) summary table Mean(Count of WW) by Fruit&lt;/P&gt;&lt;P&gt;5) summary table N(Mean(Count of WW)) by&amp;nbsp;Mean(Count of WW). I then manually add rows with value = 0 to any missing WW because those week has no new fruit. This is the table then I used to build the graph using statistic = cumulative.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dadawasozo_0-1674693221956.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/49450i03D35DBD96278D12/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dadawasozo_0-1674693221956.png" alt="dadawasozo_0-1674693221956.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 16:41:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/cumulative-of-only-new-item-exclude-repeated-by-weekly/m-p/593308#M79718</guid>
      <dc:creator>dadawasozo</dc:creator>
      <dc:date>2023-06-08T16:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative of only new item (exclude repeated) by weekly</title>
      <link>https://community.jmp.com/t5/Discussions/cumulative-of-only-new-item-exclude-repeated-by-weekly/m-p/593403#M79730</link>
      <description>&lt;P&gt;All I did to create the JSL for your chart, was to step through your stated steps, and copy the JSL from the log that JMP produced.&amp;nbsp; I did add a little original code to solve the adding of zeros in for any work weeks where there vere no new fruits, but other than that, JMP created the JSL, not me&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1674721347229.png" style="width: 848px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/49454i1F2D2C78EF50CDB1/image-dimensions/848x515?v=v2" width="848" height="515" role="button" title="txnelson_0-1674721347229.png" alt="txnelson_0-1674721347229.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=data table("Fruit by date");
// New column: Column 3
Data Table( "Fruit by date" ) &amp;lt;&amp;lt; New Column( "WW",
	Numeric,
	"ordinal",
	Format( "Best", 12 ),
	formula(week of year(:date))
);
// Data table summary
// → Data Table( "Fruit by date (1) By (Fruit, WW)" )
Data Table( "Fruit by date" ) &amp;lt;&amp;lt; Summary(
	Group( :Fruit, :WW ),
	N( :Fruit ),
	Freq( "None" ),
	Weight( "None" )
);
// Change column formula: Count of WW
Data Table( "Fruit by date By (Fruit, WW)")&amp;lt;&amp;lt;
New column("Count of WW",  Formula( Col Minimum( :WW, :Fruit ) ));

// Data table summary
// → Data Table( "Fruit by date By (Fruit, WW) By (Fruit)" )
Data Table( "Fruit by date By (Fruit, WW)" ) &amp;lt;&amp;lt;
Summary( Group( :Fruit ), Mean( :Count of WW ), Freq( "None" ), Weight( "None" ) );

// Data table summary
// → Data Table( "Fruit by date By (Fruit, WW) By (Fruit) By (Mean(Count of WW))" )
Data Table( "Fruit by date By (Fruit, WW) By (Fruit)" ) &amp;lt;&amp;lt;
Summary(
	Group( :"Mean(Count of WW)"n ),
	N( :"Mean(Count of WW)"n ),
	Freq( "None" ),
	Weight( "None" )
);

// Data table summary
// → Data Table( "Fruit by date By (WW)" )
Data Table( "Fruit by date" ) &amp;lt;&amp;lt; Summary(
	Group( :WW ),
	Freq( "None" ),
	Weight( "None" ),
	link to original data table(0)
);

for each row(
	:N Rows = 0;
);

:WW &amp;lt;&amp;lt; set name("Mean(Count of WW)");

// Update data tables
Data Table( "Fruit by date By (WW)" ) &amp;lt;&amp;lt; Update(
	With( Data Table( "Fruit by date By (Fruit, WW) By (Fruit) By (Mean(Count of WW))" ) ),
	Match Columns( :"Mean(Count of WW)"n = :"Mean(Count of WW)"n )
);

data table("Fruit by date by (WW)") &amp;lt;&amp;lt; Graph Builder(
	Size( 891, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :"Mean(Count of WW)"n ), Y( :N Rows ) ),
	Elements(
		Bar(
			X,
			Y,
			Legend( 5 ),
			Summary Statistic( "Cumulative Sum" ),
			Label( "Label by Value" )
		)
	)
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Jan 2023 08:23:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/cumulative-of-only-new-item-exclude-repeated-by-weekly/m-p/593403#M79730</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-01-26T08:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative of only new item (exclude repeated) by weekly</title>
      <link>https://community.jmp.com/t5/Discussions/cumulative-of-only-new-item-exclude-repeated-by-weekly/m-p/593486#M79736</link>
      <description>&lt;P&gt;Hi Jim&lt;/P&gt;&lt;P&gt;Thanks, is there shorter way to get to the graph? Or I have no choice must go through the steps?&lt;/P&gt;&lt;P&gt;I will have a very large data that is from daily for months and concern of if these steps are the method to deliver the output later.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 12:45:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/cumulative-of-only-new-item-exclude-repeated-by-weekly/m-p/593486#M79736</guid>
      <dc:creator>dadawasozo</dc:creator>
      <dc:date>2023-01-26T12:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative of only new item (exclude repeated) by weekly</title>
      <link>https://community.jmp.com/t5/Discussions/cumulative-of-only-new-item-exclude-repeated-by-weekly/m-p/593512#M79741</link>
      <description>&lt;P&gt;JMP can handle data tables wit billions of rows, so if you have just an average sized computer, you will not have an issue.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 14:05:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/cumulative-of-only-new-item-exclude-repeated-by-weekly/m-p/593512#M79741</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-01-26T14:05:51Z</dc:date>
    </item>
  </channel>
</rss>

