<?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: How to get variable value inside IF Condition in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-get-variable-value-inside-IF-Condition/m-p/509373#M73742</link>
    <description>&lt;P&gt;You might consider the more specialized conditional function Match(). It is a nice alternative that is perhaps clearer as far as the intent and the result&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Match( :Fruit,
	"Apple",
		color = "Red";
		Target = {50};,
	"Grapes",
		color = "Violet";
		Target = {50};,
	"Cherry",
		color = "Red";
		Target = {54};
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 14 Jun 2022 13:53:38 GMT</pubDate>
    <dc:creator>Mark_Bailey</dc:creator>
    <dc:date>2022-06-14T13:53:38Z</dc:date>
    <item>
      <title>How to get variable value inside IF Condition</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-variable-value-inside-IF-Condition/m-p/508587#M73725</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am stucked in this IF Condition, where I need to get the variable value(color) based on another column value (:Fruit). It always return an empty variable color. Please help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my sample code:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( :Fruit == "Apple",
color= "Red"; Target = {50};,
:Fruit == "Grapes",
color= "Violet"; Target = {50};,
:Fruit == "Cherry",
color= "Red"; Target = {54};
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Jun 2023 20:50:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-variable-value-inside-IF-Condition/m-p/508587#M73725</guid>
      <dc:creator>UserID16644</dc:creator>
      <dc:date>2023-06-10T20:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to get variable value inside IF Condition</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-variable-value-inside-IF-Condition/m-p/508687#M73726</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is unclear what you are trying to do given the limited context. Is this part of a JSL script or a column Formula? If it is the latter, you need to specify what the expression returns as shown below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(
	:Fruit == "Apple",
		color = "Red";
		Target = {50};,
	:Fruit == "Grapes",
		color = "Violet";
		Target = {50};,
	:Fruit == "Cherry",
		color = "Red";
		Target = {54};
);
color;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also,&amp;nbsp; are you sure that the column's content :Fruit matches precisely the values in your expression (i.e., no leading or trailing spaces)?&lt;/P&gt;
&lt;P&gt;An example of the usage context for this expression would help figure out what may be going on.&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;TS&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 01:22:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-variable-value-inside-IF-Condition/m-p/508687#M73726</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2022-06-14T01:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to get variable value inside IF Condition</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-variable-value-inside-IF-Condition/m-p/509373#M73742</link>
      <description>&lt;P&gt;You might consider the more specialized conditional function Match(). It is a nice alternative that is perhaps clearer as far as the intent and the result&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Match( :Fruit,
	"Apple",
		color = "Red";
		Target = {50};,
	"Grapes",
		color = "Violet";
		Target = {50};,
	"Cherry",
		color = "Red";
		Target = {54};
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Jun 2022 13:53:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-variable-value-inside-IF-Condition/m-p/509373#M73742</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2022-06-14T13:53:38Z</dc:date>
    </item>
  </channel>
</rss>

