<?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: Nested IF by variables with IF in Load statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Nested-IF-by-variables-with-IF-in-Load-statement/m-p/1139087#M373550</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Marcus. Now I did this. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&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;product&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;category&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;delivery_date as LADate&lt;/P&gt;&lt;P&gt;From xyz.qvd (qvd)&lt;/P&gt;&lt;P&gt;Where category = 'LA' ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join&lt;/P&gt;&lt;P&gt;LOAD&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;product,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;category,&lt;/P&gt;&lt;P&gt;delivery_date as ABDate&lt;/P&gt;&lt;P&gt;From &lt;SPAN style="font-size: 13.3333px;"&gt;xyz&lt;/SPAN&gt;.qvd (qvd)&lt;/P&gt;&lt;P&gt;Where sap_confirm_category = 'AB' ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer the sample table format and column names into which i have to load values. It's actually count values by month. I have to do 4 things here.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;1.) Count total order lines (with a condition acct_assignment_cat = '' OR ' ' )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;2.) Delayed order lines ( with the condition if( LADate &amp;gt; ABDate , count (product))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;3.) On time order lines (&lt;SPAN style="font-size: 13.3333px;"&gt; with the condition if( &lt;SPAN style="font-size: 13.3333px;"&gt;ABDate&lt;/SPAN&gt;&amp;gt; &lt;SPAN style="font-size: 13.3333px;"&gt;LADate &lt;/SPAN&gt;, count (product))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;4.) COT % ( On time &lt;SPAN style="font-size: 13.3333px;"&gt;order &lt;SPAN style="font-size: 13.3333px;"&gt;lines &lt;/SPAN&gt; &lt;/SPAN&gt; / total &lt;SPAN style="font-size: 13.3333px;"&gt;order &lt;SPAN style="font-size: 13.3333px;"&gt;lines * 100 )&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i achieve&amp;nbsp; all ? why because I am confused to put condition in load statement for loading dates and to put conditions to show the count for total , delayed , on time in the table. please clarify.&lt;/P&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;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-James&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Aug 2016 08:49:48 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-08-08T08:49:48Z</dc:date>
    <item>
      <title>Nested IF by variables with IF in Load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-IF-by-variables-with-IF-in-Load-statement/m-p/1139085#M373548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello folks,&lt;/P&gt;&lt;P&gt;I am loading some fields along with the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;product,&lt;/P&gt;&lt;P&gt;category,&lt;/P&gt;&lt;P&gt;delivery_date,&lt;/P&gt;&lt;P&gt;if ($(vIsLAConf) &amp;gt; $(vIsABConfLatest),0) as Delayed,&lt;/P&gt;&lt;P&gt;if ($(vIsLAConf) &amp;lt; $(vIsABConfLatest),0) as OnTime&lt;/P&gt;&lt;P&gt;FROM xyz.qvd (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;execution log for the if statement:&lt;/P&gt;&lt;P&gt;-------------------------------------------------&lt;/P&gt;&lt;P&gt;0030&amp;nbsp; if (if(category = 'LA' , delivery_date) &amp;gt; if(category = 'AB' , delivery_date),0) as Delayed,&lt;/P&gt;&lt;P&gt;0031&amp;nbsp; if (if(category = 'LA' , delivery_date) &amp;lt; if(category = 'AB' , delivery_date),0) as OnTime&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The thing here is , i want to display the count of 'Delayed' and&amp;nbsp; 'OnTime' for every product. Please help me to correct this nested IF formed above so that i will get the correct count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached snap is sample data from xyz.qvd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2016 12:00:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-IF-by-variables-with-IF-in-Load-statement/m-p/1139085#M373548</guid>
      <dc:creator />
      <dc:date>2016-08-05T12:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Nested IF by variables with IF in Load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-IF-by-variables-with-IF-in-Load-statement/m-p/1139086#M373549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You approach couldn't work because you could in this way only check values which are within the same record. This meant you will need to bring these different records into a single record with a logic like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load * FROM xyz.qvd (qvd);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; left join&lt;/P&gt;&lt;P&gt;load product, category, delivery_date as NewDate FROM xyz.qvd (qvd) where category = 'AB';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might need some further adjustements to the where clauses to determine which records should be merged and afterwards you could load these new created table and make there your comparisation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2016 13:49:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-IF-by-variables-with-IF-in-Load-statement/m-p/1139086#M373549</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-08-05T13:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Nested IF by variables with IF in Load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-IF-by-variables-with-IF-in-Load-statement/m-p/1139087#M373550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Marcus. Now I did this. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&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;product&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;category&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;delivery_date as LADate&lt;/P&gt;&lt;P&gt;From xyz.qvd (qvd)&lt;/P&gt;&lt;P&gt;Where category = 'LA' ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join&lt;/P&gt;&lt;P&gt;LOAD&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;product,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;category,&lt;/P&gt;&lt;P&gt;delivery_date as ABDate&lt;/P&gt;&lt;P&gt;From &lt;SPAN style="font-size: 13.3333px;"&gt;xyz&lt;/SPAN&gt;.qvd (qvd)&lt;/P&gt;&lt;P&gt;Where sap_confirm_category = 'AB' ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer the sample table format and column names into which i have to load values. It's actually count values by month. I have to do 4 things here.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;1.) Count total order lines (with a condition acct_assignment_cat = '' OR ' ' )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;2.) Delayed order lines ( with the condition if( LADate &amp;gt; ABDate , count (product))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;3.) On time order lines (&lt;SPAN style="font-size: 13.3333px;"&gt; with the condition if( &lt;SPAN style="font-size: 13.3333px;"&gt;ABDate&lt;/SPAN&gt;&amp;gt; &lt;SPAN style="font-size: 13.3333px;"&gt;LADate &lt;/SPAN&gt;, count (product))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;4.) COT % ( On time &lt;SPAN style="font-size: 13.3333px;"&gt;order &lt;SPAN style="font-size: 13.3333px;"&gt;lines &lt;/SPAN&gt; &lt;/SPAN&gt; / total &lt;SPAN style="font-size: 13.3333px;"&gt;order &lt;SPAN style="font-size: 13.3333px;"&gt;lines * 100 )&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i achieve&amp;nbsp; all ? why because I am confused to put condition in load statement for loading dates and to put conditions to show the count for total , delayed , on time in the table. please clarify.&lt;/P&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;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-James&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 08:49:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-IF-by-variables-with-IF-in-Load-statement/m-p/1139087#M373550</guid>
      <dc:creator />
      <dc:date>2016-08-08T08:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: Nested IF by variables with IF in Load statement</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-IF-by-variables-with-IF-in-Load-statement/m-p/1139088#M373551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would create a flag in a following load like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp:&lt;/P&gt;&lt;P&gt;LOAD &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;product&lt;/SPAN&gt;, &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;category&lt;/SPAN&gt;, delivery_date as LADate&lt;/P&gt;&lt;P&gt;From xyz.qvd (qvd) Where category = 'LA' ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (temp)&lt;/P&gt;&lt;P&gt;LOAD &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;product, &lt;/SPAN&gt;category, delivery_date as ABDate&lt;/P&gt;&lt;P&gt;From &lt;SPAN style="font-size: 13.3333px;"&gt;xyz&lt;/SPAN&gt;.qvd (qvd) Where sap_confirm_category = 'AB' ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;final:&lt;/P&gt;&lt;P&gt;LOAD *, if(&lt;SPAN style="font-size: 10pt;"&gt;LADate &amp;gt; ABDate, 1, 2) as Flag resident temp:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;drop tables temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;and within a chart you could calculate:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;count({&amp;lt; Flag = {1}&amp;gt;} product)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;count({&amp;lt; Flag = {2}&amp;gt;} product)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;count({&amp;lt; Flag = {1}&amp;gt;} product) / &lt;SPAN style="font-size: 10pt;"&gt;count({&amp;lt; Flag = {2}&amp;gt;} product)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;- Marcus&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 10:35:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-IF-by-variables-with-IF-in-Load-statement/m-p/1139088#M373551</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-08-08T10:35:26Z</dc:date>
    </item>
  </channel>
</rss>

