<?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: Changing a field value from -1 to 'Y' in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Changing-a-field-value-from-1-to-Y/m-p/1307011#M839480</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Samantha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to enclose everything into another IF statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;If(sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;TOTAL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[SWIFT ID]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;len&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SCHEDULESALTWEEKLYCOST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;gt;0, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SCHEDULESALTWEEKLYCOST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;len&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SCHEDULESALTWEEKLYCOST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)=0,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;STDWEEKCOST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))) &amp;lt;='250.00' , 'Y', 'N')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;Few notes:&lt;/P&gt;&lt;P&gt;- you don't need quotes when comparing to numbers &amp;lt;= '250.00'. In this case, Qlik is doing a string comparison instead of number comparison.&lt;/P&gt;&lt;P&gt;- I suppose the &lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SCHEDULESALTWEEKLYCOST&lt;/SPAN&gt; field is sometimes null since you use that if test. Have a look at Alt() function. It is faster and easier to read (e.g &lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;If(sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;TOTAL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[SWIFT ID]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;gt;&amp;nbsp; Alt(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SCHEDULESALTWEEKLYCOST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;STDWEEKCOST, 0&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;= 250 , 'Y', 'N'))&lt;/SPAN&gt;). If it doesn't work, consider to move the if test in the script to increase the front end performance (IF statements are pretty slow in expression)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 May 2017 08:35:48 GMT</pubDate>
    <dc:creator>daveamz</dc:creator>
    <dc:date>2017-05-09T08:35:48Z</dc:date>
    <item>
      <title>Changing a field value from -1 to 'Y'</title>
      <link>https://community.qlik.com/t5/QlikView/Changing-a-field-value-from-1-to-Y/m-p/1307010#M839479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working with cost information for clients and each individual client needs to have a spend banding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created the following expression to show the spend banding of anything less than £250.00 - It is currently showing as 0 and -1 figures and&amp;nbsp; I am unsure of how to change the figure to 'Y' rather than -1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;TOTAL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[SWIFT ID]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;len&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SCHEDULESALTWEEKLYCOST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;gt;0, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SCHEDULESALTWEEKLYCOST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;len&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SCHEDULESALTWEEKLYCOST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)=0,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;STDWEEKCOST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))) &amp;lt;='250.00' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/162585_pastedImage_0.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help? I have tried changing the values and I am having no luck. I am wondering if this is something to do with how I have created my expression and maybe that is wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much appreciated.&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;P&gt;&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/Changing-a-field-value-from-1-to-Y/m-p/1307010#M839479</guid>
      <dc:creator>samantha92</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Changing a field value from -1 to 'Y'</title>
      <link>https://community.qlik.com/t5/QlikView/Changing-a-field-value-from-1-to-Y/m-p/1307011#M839480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Samantha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to enclose everything into another IF statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;If(sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;TOTAL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[SWIFT ID]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;len&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SCHEDULESALTWEEKLYCOST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;gt;0, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SCHEDULESALTWEEKLYCOST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;len&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SCHEDULESALTWEEKLYCOST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)=0,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;STDWEEKCOST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))) &amp;lt;='250.00' , 'Y', 'N')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;Few notes:&lt;/P&gt;&lt;P&gt;- you don't need quotes when comparing to numbers &amp;lt;= '250.00'. In this case, Qlik is doing a string comparison instead of number comparison.&lt;/P&gt;&lt;P&gt;- I suppose the &lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SCHEDULESALTWEEKLYCOST&lt;/SPAN&gt; field is sometimes null since you use that if test. Have a look at Alt() function. It is faster and easier to read (e.g &lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;If(sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;TOTAL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[SWIFT ID]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;gt;&amp;nbsp; Alt(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SCHEDULESALTWEEKLYCOST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;STDWEEKCOST, 0&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;= 250 , 'Y', 'N'))&lt;/SPAN&gt;). If it doesn't work, consider to move the if test in the script to increase the front end performance (IF statements are pretty slow in expression)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2017 08:35:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Changing-a-field-value-from-1-to-Y/m-p/1307011#M839480</guid>
      <dc:creator>daveamz</dc:creator>
      <dc:date>2017-05-09T08:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Changing a field value from -1 to 'Y'</title>
      <link>https://community.qlik.com/t5/QlikView/Changing-a-field-value-from-1-to-Y/m-p/1307012#M839481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That works a charm - thanks so much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Really good advice with the Alt() function - I need to read up on enhancing my expression for performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you again &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2017 08:41:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Changing-a-field-value-from-1-to-Y/m-p/1307012#M839481</guid>
      <dc:creator>samantha92</dc:creator>
      <dc:date>2017-05-09T08:41:19Z</dc:date>
    </item>
  </channel>
</rss>

