<?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: set a variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/set-a-variable/m-p/85728#M752819</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure, what do you mean by string? May be this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;if('$(v_metric_5)'&amp;lt;90,'red',if('$(v_metric_5)'&amp;lt;95,'yellow',if('$(v_metric_5)'&amp;lt;=100,'green','gray')))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;How you have created this variable &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;v_metric_5&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Oct 2018 08:56:03 GMT</pubDate>
    <dc:creator>Anil_Babu_Samineni</dc:creator>
    <dc:date>2018-10-29T08:56:03Z</dc:date>
    <item>
      <title>set a variable</title>
      <link>https://community.qlik.com/t5/QlikView/set-a-variable/m-p/85727#M752818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;BR /&gt;i want to set a variable in the script that have-&lt;BR /&gt;if($(v_metric_5)&amp;lt;90,'red',if($(v_metric_5)&amp;lt;95,'yellow',if($(v_metric_5)&amp;lt;=100,'green','gray')))&lt;/P&gt;&lt;P&gt;how can i do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i dont want that $(v_metric_5) will calculate&lt;/P&gt;&lt;P&gt;i want it to stay as a string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;adi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-a-variable/m-p/85727#M752818</guid>
      <dc:creator>adiarnon</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: set a variable</title>
      <link>https://community.qlik.com/t5/QlikView/set-a-variable/m-p/85728#M752819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure, what do you mean by string? May be this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;if('$(v_metric_5)'&amp;lt;90,'red',if('$(v_metric_5)'&amp;lt;95,'yellow',if('$(v_metric_5)'&amp;lt;=100,'green','gray')))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;How you have created this variable &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;v_metric_5&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2018 08:56:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-a-variable/m-p/85728#M752819</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-10-29T08:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: set a variable</title>
      <link>https://community.qlik.com/t5/QlikView/set-a-variable/m-p/85729#M752820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes what is that v_metric_5 ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it is a variable ?? if varible then it will take the values as per the variable value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it is field&amp;nbsp; then you no need to consider it as string or any other format...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2018 10:43:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-a-variable/m-p/85729#M752820</guid>
      <dc:creator>vishalgoud</dc:creator>
      <dc:date>2018-10-29T10:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: set a variable</title>
      <link>https://community.qlik.com/t5/QlikView/set-a-variable/m-p/85730#M752821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="font-size: 11.7px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;A href="https://community.qlik.com/people/adiarnon"&gt;adiarnon&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the difference between setting the variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vVariable = 1 + 2; //Value returned 1 + 2&lt;/P&gt;&lt;P&gt;LET vVariable = 1 + 2; //Value returned 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the attachment that might be helpful.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Screenshot_1.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/216965_Screenshot_1.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2018 11:12:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-a-variable/m-p/85730#M752821</guid>
      <dc:creator>MindaugasBacius</dc:creator>
      <dc:date>2018-10-29T11:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: set a variable</title>
      <link>https://community.qlik.com/t5/QlikView/set-a-variable/m-p/85731#M752822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dollar Sign Expansion (DSE) always occurs in script, which is generally a blessing but sometimes a curse.&amp;nbsp; One workaround is to use a proxy character for the $ and then replace(). For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET v1 = replace(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;'if(@(v_metric_5)&amp;lt;90,''red'',if(@(v_metric_5)&amp;lt;95,''yellow'',if(@(v_metric_5)&amp;lt;=100,''green'',''gray'')))'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;,'@','$');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will need to double up your single quotes to allow them within the LET string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another approach is to use a proxy char for both $ and ' replacing both with a mapsubstring:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;EscapeCharsMap:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;MAPPING LOAD * INLINE [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;from, to&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;@,$&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;|,'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET v2 = MapSubString('EscapeCharsMap',&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;'if(@(v_metric_5)&amp;lt;90,|red|,if(@(v_metric_5)&amp;lt;95,|yellow|,if(@(v_metric_5)&amp;lt;=100,|green|,|gray|)))'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com/" rel="nofollow" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com/" rel="nofollow" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.easyqlik.com/" rel="nofollow" target="_blank"&gt;http://www.easyqlik.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2018 11:43:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-a-variable/m-p/85731#M752822</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2018-10-29T11:43:23Z</dc:date>
    </item>
  </channel>
</rss>

