<?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 Variable to Text Value with an if(then) statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Variable-to-Text-Value-with-an-if-then-statement/m-p/888149#M1016065</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Hi Erka,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;What you could do is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;While loading the table itself load additional column in your script. See script below for details:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Load&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Date_Closed,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;if(&lt;SPAN style="color: #0000ff;"&gt;IsNull&lt;/SPAN&gt;(date_closed) &lt;SPAN style="color: #0000ff;"&gt;or&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;Trim&lt;/SPAN&gt;(date_closed) ='', 'Open','Closed') as Status&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;From ...... ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;and use the new field 'Status' as a list box for filter and in your expression for chart calculation. Hope it should work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Please confirm whether it worked or not.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks and regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Ritesh Pathak&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Apr 2015 00:47:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-04-10T00:47:36Z</dc:date>
    <item>
      <title>Set Variable to Text Value with an if(then) statement</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Variable-to-Text-Value-with-an-if-then-statement/m-p/888145#M1016061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;New to qlik so this is probably a simple fix but I am just missing the solution.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a data set with a field called date_closed.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I want to create a variable that will display the text 'Open' anytime that field is null, and 'Closed' if the field is not null.&lt;/P&gt;&lt;P&gt;This is the script I have been trying to use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vRecordStatus =IF(IsNull(date_closed), 'Open', 'Closed') ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 23:12:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Variable-to-Text-Value-with-an-if-then-statement/m-p/888145#M1016061</guid>
      <dc:creator>leale1997</dc:creator>
      <dc:date>2015-04-09T23:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Set Variable to Text Value with an if(then) statement</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Variable-to-Text-Value-with-an-if-then-statement/m-p/888146#M1016062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erka,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression is fine. Just that use LET in place of SET. Your expression would be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vRecordStatus =IF(IsNull(date_closed), 'Open', 'Closed') ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Ritesh Pathak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 23:22:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Variable-to-Text-Value-with-an-if-then-statement/m-p/888146#M1016062</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-09T23:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Set Variable to Text Value with an if(then) statement</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Variable-to-Text-Value-with-an-if-then-statement/m-p/888147#M1016063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much!&amp;nbsp; That worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I bother you with one more question?&amp;nbsp; I want to assign the variable to an input box so that a drop down will appear, allow the user to choose between 'Open' and 'Closed' and change all the records on the page to correspond to the variable selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created an input box and assigned the variable I created.&amp;nbsp; But only the 'Open' is appearing with no option to choose 'Closed'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 23:32:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Variable-to-Text-Value-with-an-if-then-statement/m-p/888147#M1016063</guid>
      <dc:creator>leale1997</dc:creator>
      <dc:date>2015-04-09T23:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Set Variable to Text Value with an if(then) statement</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Variable-to-Text-Value-with-an-if-then-statement/m-p/888148#M1016064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erka,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please goto variable overview and delete your variable vRecordStatus and then use below expression for your variable creation&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;LET vRecordStatus = if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IsNull&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;date_closed&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Trim&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;date_closed&lt;SPAN style="font-size: 8pt;"&gt;) ='', 'Open','Close') ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;it should work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Let me know if you face any more issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Cheers,&lt;BR /&gt;Ritesh Pathak&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 23:50:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Variable-to-Text-Value-with-an-if-then-statement/m-p/888148#M1016064</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-09T23:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Set Variable to Text Value with an if(then) statement</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Variable-to-Text-Value-with-an-if-then-statement/m-p/888149#M1016065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Hi Erka,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;What you could do is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;While loading the table itself load additional column in your script. See script below for details:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Load&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Date_Closed,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;if(&lt;SPAN style="color: #0000ff;"&gt;IsNull&lt;/SPAN&gt;(date_closed) &lt;SPAN style="color: #0000ff;"&gt;or&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;Trim&lt;/SPAN&gt;(date_closed) ='', 'Open','Closed') as Status&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;From ...... ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;and use the new field 'Status' as a list box for filter and in your expression for chart calculation. Hope it should work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Please confirm whether it worked or not.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks and regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Ritesh Pathak&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Apr 2015 00:47:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Variable-to-Text-Value-with-an-if-then-statement/m-p/888149#M1016065</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-10T00:47:36Z</dc:date>
    </item>
  </channel>
</rss>

