<?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 Script Logic in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Script-Logic/m-p/690777#M674240</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is difference between these two logic, even then given same output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Category,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Spent,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Category = 'car maint.' or Category = 'haircut' or Category = 'misc.','Non-Recurring Spent','Recurring Spend') as Category_Type&lt;/P&gt;&lt;P&gt;Resident Test;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Category,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Spent,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Category = 'car maint.' or Category = 'haircut' or Category = 'misc.',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dual('Non-Recurring Spent',1), Dual('Recurring Spend',0)) as Category_Type&lt;/P&gt;&lt;P&gt;Resident Test;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Thanks and Regards,&lt;/P&gt;&lt;P&gt;Villyee Anderson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Jul 2014 11:06:53 GMT</pubDate>
    <dc:creator>vanderson009</dc:creator>
    <dc:date>2014-07-31T11:06:53Z</dc:date>
    <item>
      <title>Script Logic</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Logic/m-p/690777#M674240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is difference between these two logic, even then given same output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Category,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Spent,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Category = 'car maint.' or Category = 'haircut' or Category = 'misc.','Non-Recurring Spent','Recurring Spend') as Category_Type&lt;/P&gt;&lt;P&gt;Resident Test;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Category,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Spent,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Category = 'car maint.' or Category = 'haircut' or Category = 'misc.',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dual('Non-Recurring Spent',1), Dual('Recurring Spend',0)) as Category_Type&lt;/P&gt;&lt;P&gt;Resident Test;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Thanks and Regards,&lt;/P&gt;&lt;P&gt;Villyee Anderson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2014 11:06:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Logic/m-p/690777#M674240</guid>
      <dc:creator>vanderson009</dc:creator>
      <dc:date>2014-07-31T11:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Script Logic</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Logic/m-p/690778#M674241</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;The output is not the same. The first produces Category_Type as a normal text field. The second returns Category_Type as a numeric field with values 0 and 1, and with display representations as defined in the dual command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The advantage of duals is that you can sort them numerically, like Month() which sorts correctly in month order and not alphabetically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2014 11:15:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Logic/m-p/690778#M674241</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-07-31T11:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Script Logic</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Logic/m-p/690779#M674242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dual() Function is used to forcefully assign a number to Text Field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, In 1st Code, you are Hardcoding the cases based on conditions and it is coming in Text Format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In 2nd Code, You are doing the same thing but only difference is that you are using Dual() function which forcefully convers the Text 'Non-Recurring Spent' &amp;amp; 'Recurring Spend' to Number. When you Sort this Field Category_Type, it will Sort in the Assigned Numbers Orders. Eg.&amp;nbsp; 'Recurring Spend' comes first since it has been assigned Number 0 and then comes 'Non-Recurring Spent' which has been assigned number 1.&lt;/P&gt;&lt;P&gt;This happens when you do Sorting in Ascending Order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that clears some of your doubts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Aviral Nag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2014 11:24:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Logic/m-p/690779#M674242</guid>
      <dc:creator>aveeeeeee7en</dc:creator>
      <dc:date>2014-07-31T11:24:17Z</dc:date>
    </item>
  </channel>
</rss>

