<?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: Formula for Grouping months by season in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Formula-for-Grouping-months-by-season/m-p/45751#M26121</link>
    <description>&lt;P&gt;As Jim points out, the sytax requires that the OR statement repeat the column = within the statement.&amp;nbsp; Match does work better, but why not just use the column Recode utility (which will produce the match formula)?&lt;/P&gt;</description>
    <pubDate>Wed, 11 Oct 2017 13:07:26 GMT</pubDate>
    <dc:creator>dale_lehman</dc:creator>
    <dc:date>2017-10-11T13:07:26Z</dc:date>
    <item>
      <title>Formula for Grouping months by season</title>
      <link>https://community.jmp.com/t5/Discussions/Formula-for-Grouping-months-by-season/m-p/45733#M26110</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I thought this was a rather simple formula to create, but found myself receiving formatting errors.&lt;/P&gt;&lt;P&gt;I have a column, character type, that contains months (October, November, December, and so on...).&amp;nbsp; I created a new column called "season" and wrote an IF(Contains(...formula to claasifiy if the month is October Then = fall,&amp;nbsp; and so on through the list creating the 4 categories (summer, winter, spring, fall).&amp;nbsp; However, the CONTAINS will not take the OR.&lt;/P&gt;&lt;P&gt;i.e.&lt;/P&gt;&lt;P&gt;If(Contains(:month, "October" | "November"), "fall", Empty())&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing?&amp;nbsp; Any assistance would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 21:31:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formula-for-Grouping-months-by-season/m-p/45733#M26110</guid>
      <dc:creator>Onjai</dc:creator>
      <dc:date>2017-10-10T21:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Formula for Grouping months by season</title>
      <link>https://community.jmp.com/t5/Discussions/Formula-for-Grouping-months-by-season/m-p/45736#M26112</link>
      <description>&lt;P&gt;Take a look at the 'Match()' function in 'Help &amp;gt; Scripting Index'.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 21:43:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formula-for-Grouping-months-by-season/m-p/45736#M26112</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2017-10-10T21:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Formula for Grouping months by season</title>
      <link>https://community.jmp.com/t5/Discussions/Formula-for-Grouping-months-by-season/m-p/45740#M26116</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(Contains(:month, "October") | Contains(:month, "November"), "fall", "")&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The above is the correct syntax for the approach you were taking.&amp;nbsp; However, Ian's approach is a more readable, and therefore more proper method&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 23:06:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formula-for-Grouping-months-by-season/m-p/45740#M26116</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-10-10T23:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Formula for Grouping months by season</title>
      <link>https://community.jmp.com/t5/Discussions/Formula-for-Grouping-months-by-season/m-p/45744#M26117</link>
      <description>&lt;P&gt;You can search a column for a list of values.&amp;nbsp; Here's a formula that uses that approach.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "test", Add Rows( 12 ), 
	New Column( "Month", Character, "Nominal",
		Set Values(
			{"January", "February", "March", "April", "May", "June", "July",
			"August", "September", "October", "November", "December"}
		)
	),
	New Column( "Season",
		Character,
		"Nominal",
		Formula(
			spring_list = {"March", "April", "May"};
			summer_list = {"June", "July", "August"};
			fall_list   = {"September", "October", "November"};
			winter_list = {"December", "January", "February"};
			If( Contains( spring_list, :Month ), "Spring",
				Contains( summer_list, :Month ), "Summer",
				Contains( fall_list,   :Month ), "Fall",
				Contains( winter_list, :Month ), "Winter",
				
			);
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Oct 2017 12:31:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formula-for-Grouping-months-by-season/m-p/45744#M26117</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2017-10-11T12:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Formula for Grouping months by season</title>
      <link>https://community.jmp.com/t5/Discussions/Formula-for-Grouping-months-by-season/m-p/45751#M26121</link>
      <description>&lt;P&gt;As Jim points out, the sytax requires that the OR statement repeat the column = within the statement.&amp;nbsp; Match does work better, but why not just use the column Recode utility (which will produce the match formula)?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 13:07:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formula-for-Grouping-months-by-season/m-p/45751#M26121</guid>
      <dc:creator>dale_lehman</dc:creator>
      <dc:date>2017-10-11T13:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: Formula for Grouping months by season</title>
      <link>https://community.jmp.com/t5/Discussions/Formula-for-Grouping-months-by-season/m-p/45758#M26124</link>
      <description>&lt;P&gt;Ian,&lt;/P&gt;&lt;P&gt;Worked fine!&amp;nbsp; Nice and clean.&lt;/P&gt;&lt;P&gt;Thank you and the rest of the fine folks in the jmp community.&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 13:52:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formula-for-Grouping-months-by-season/m-p/45758#M26124</guid>
      <dc:creator>Onjai</dc:creator>
      <dc:date>2017-10-11T13:52:10Z</dc:date>
    </item>
  </channel>
</rss>

