<?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: Question Regarding &amp;quot;contains()&amp;quot; formula in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Question-Regarding-quot-contains-quot-formula/m-p/235811#M46514</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/16878"&gt;@Emily_Day&lt;/a&gt;I am not sure I understand your logic completely, but perhaps the following will help.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

dt = New Table( "Sample",
	Add Rows( 3 ),
	New Column( "Data",
		Character,
		"Nominal",
		Set Values( {"1,2,3,6,11", "2,5,6,11", "3,11,12,13"} )
	)
);

dt &amp;lt;&amp;lt; Text To Columns(
	delimiter( "," ),
	columns( :Data )
);

dtStacked = dt &amp;lt;&amp;lt; Stack(
	columns( :Data 1, :Data 2, :Data 3, :Data 4, :Data 5 ),
	Source Label Column( "Label" ),
	Stacked Data Column( "Response" ),
	Output Table Name("StackedData")
);
dtStacked:Response&amp;lt;&amp;lt;Data Type("Numeric");

dtStacked &amp;lt;&amp;lt; New Column(
	"Answer",
	Numeric,
	Nominal,
	Formula(
		"Insert your Logic Here"
	)
);

dtWide = dtStacked &amp;lt;&amp;lt; Split(
	Split By( :Label ),
	Split( :Answer ),
	Group( :Data ),
	Remaining Columns( Drop All ),
	Sort by Column Property,
	Ouput Table Name("WideData")
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 20 Nov 2019 19:03:05 GMT</pubDate>
    <dc:creator>G_M</dc:creator>
    <dc:date>2019-11-20T19:03:05Z</dc:date>
    <item>
      <title>Question Regarding "contains()" formula</title>
      <link>https://community.jmp.com/t5/Discussions/Question-Regarding-quot-contains-quot-formula/m-p/235766#M46507</link>
      <description>&lt;P&gt;I have a set of CATA data where the nominal data looks like column "Data" below.&amp;nbsp; I'm attempting to create an additional column for each selection (like "Answer 1, Answer 2, etc. below) where "0" = not found in the list and "1"= found. &amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my formula: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;FONT face="Verdana,Arial,Helvetica,sans-serif"&gt;Contains( :Name( "Data" ), "1" ) &amp;gt; 0&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana,Arial,Helvetica,sans-serif"&gt;However, it is picking up the number 1 from an 11 and is returning a "1" response for Answer 1 when it should be "0".&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana,Arial,Helvetica,sans-serif"&gt;Maybe I've gone about this all wrong and there is a better way to accomplish this task?&amp;nbsp; Any suggestions?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;Data&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#0000ff"&gt;Answer 1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#0000ff"&gt;Answer 2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#0000ff"&gt;Answer 3&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1,2,3,6,11&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2,5,6,11&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3,11,12,13&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 20 Nov 2019 17:19:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Question-Regarding-quot-contains-quot-formula/m-p/235766#M46507</guid>
      <dc:creator>Emily_Day</dc:creator>
      <dc:date>2019-11-20T17:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Question Regarding "contains()" formula</title>
      <link>https://community.jmp.com/t5/Discussions/Question-Regarding-quot-contains-quot-formula/m-p/235791#M46510</link>
      <description>&lt;P&gt;This might help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;select your "Data" column&lt;/P&gt;
&lt;P&gt;Cols&amp;gt;Utilities&amp;gt;Text into columns&lt;/P&gt;
&lt;P&gt;then use "," as the delimiter and check the, Make Indicator columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 18:55:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Question-Regarding-quot-contains-quot-formula/m-p/235791#M46510</guid>
      <dc:creator>Byron_JMP</dc:creator>
      <dc:date>2019-11-20T18:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Question Regarding "contains()" formula</title>
      <link>https://community.jmp.com/t5/Discussions/Question-Regarding-quot-contains-quot-formula/m-p/235810#M46513</link>
      <description>&lt;P&gt;Beautiful!&amp;nbsp; That is exactly what I needed and way easier than my round-about method.&lt;/P&gt;&lt;P&gt;Much appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 19:02:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Question-Regarding-quot-contains-quot-formula/m-p/235810#M46513</guid>
      <dc:creator>Emily_Day</dc:creator>
      <dc:date>2019-11-20T19:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Question Regarding "contains()" formula</title>
      <link>https://community.jmp.com/t5/Discussions/Question-Regarding-quot-contains-quot-formula/m-p/235811#M46514</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/16878"&gt;@Emily_Day&lt;/a&gt;I am not sure I understand your logic completely, but perhaps the following will help.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

dt = New Table( "Sample",
	Add Rows( 3 ),
	New Column( "Data",
		Character,
		"Nominal",
		Set Values( {"1,2,3,6,11", "2,5,6,11", "3,11,12,13"} )
	)
);

dt &amp;lt;&amp;lt; Text To Columns(
	delimiter( "," ),
	columns( :Data )
);

dtStacked = dt &amp;lt;&amp;lt; Stack(
	columns( :Data 1, :Data 2, :Data 3, :Data 4, :Data 5 ),
	Source Label Column( "Label" ),
	Stacked Data Column( "Response" ),
	Output Table Name("StackedData")
);
dtStacked:Response&amp;lt;&amp;lt;Data Type("Numeric");

dtStacked &amp;lt;&amp;lt; New Column(
	"Answer",
	Numeric,
	Nominal,
	Formula(
		"Insert your Logic Here"
	)
);

dtWide = dtStacked &amp;lt;&amp;lt; Split(
	Split By( :Label ),
	Split( :Answer ),
	Group( :Data ),
	Remaining Columns( Drop All ),
	Sort by Column Property,
	Ouput Table Name("WideData")
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Nov 2019 19:03:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Question-Regarding-quot-contains-quot-formula/m-p/235811#M46514</guid>
      <dc:creator>G_M</dc:creator>
      <dc:date>2019-11-20T19:03:05Z</dc:date>
    </item>
  </channel>
</rss>

