<?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 Using If/Else statement during LOAD in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-If-Else-statement-during-LOAD/m-p/166551#M38457</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Thiago,&lt;/P&gt;&lt;P&gt;It seems that you have your If() function in two lines, which is not valid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;if([Partner Code] = 'NOT FOUND' OR LEN(TRIM([Partner Code])) = 0, 'no', 'yes') as temnodic&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;This should work.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Jan 2011 19:33:36 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2011-01-12T19:33:36Z</dc:date>
    <item>
      <title>Using If/Else statement during LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Using-If-Else-statement-during-LOAD/m-p/166548#M38454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings!&lt;/P&gt;&lt;P&gt;I have searched for this as much as I could in the QV documentation, but found no info...&lt;/P&gt;&lt;P&gt;What is the syntax for an IF statement during a LOAD?&lt;/P&gt;&lt;P&gt;Here is what I'm trying to do:&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;BR /&gt;&lt;BR /&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;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&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;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;load&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;*,&lt;BR /&gt;if (([Partner Code]='' || [Partner Code] || 'NOT FOUND' || LEN(TRIM([Partner Code]))=0,'No'),Expression-1,'Yes') &lt;BR /&gt;&lt;B&gt;as&lt;/B&gt; result&lt;BR /&gt;&lt;B&gt;resident market_temp;&lt;/B&gt;&lt;P style="font-weight: bold"&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;Any thoughts???&lt;/P&gt;&lt;P&gt;Thanx 1 more time!&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&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;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jan 2011 17:15:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-If-Else-statement-during-LOAD/m-p/166548#M38454</guid>
      <dc:creator />
      <dc:date>2011-01-12T17:15:18Z</dc:date>
    </item>
    <item>
      <title>Using If/Else statement during LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Using-If-Else-statement-during-LOAD/m-p/166549#M38455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Thiago,&lt;/P&gt;&lt;P&gt;a first guess would be:&lt;/P&gt;&lt;P&gt;if( &lt;B&gt;&lt;/B&gt;[Partner Code] = 'NOT FOUND' OR LEN(TRIM([Partner Code]))=0, 'no', 'yes')&lt;/P&gt;&lt;P&gt;which means with len(...)=0 you should not need the first part. The return value for the then-case is after the first comma (='no'), else case after second comma (='yes'). I didn't recognize what to do with "Expression-1" but the term above should lead you into the right direction.&lt;/P&gt;&lt;P&gt;Regards, Roland&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jan 2011 17:30:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-If-Else-statement-during-LOAD/m-p/166549#M38455</guid>
      <dc:creator />
      <dc:date>2011-01-12T17:30:18Z</dc:date>
    </item>
    <item>
      <title>Using If/Else statement during LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Using-If-Else-statement-during-LOAD/m-p/166550#M38456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Roland, thank you very much,it worked!&lt;/P&gt;&lt;P&gt;But another problem has emerged...&lt;/P&gt;&lt;P&gt;This Code:&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;BR /&gt;&lt;BR /&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;&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;&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;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;load&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;Customer_Shipper &lt;P&gt;,&lt;/P&gt;&lt;P&gt;sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;(Teus) &lt;B&gt;as&lt;/B&gt; SUMTEUS &lt;P&gt;,&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;( [Partner Code] = 'NOT FOUND' &lt;B&gt;OR&lt;/B&gt; LEN(TRIM([Partner Code]))=0, 'no', 'yes') &lt;B&gt;as&lt;/B&gt; &lt;P&gt;temnodic&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;resident&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;market_temp&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;group&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;B&gt;by&lt;/B&gt; &lt;P&gt;Customer_Shipper;&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;drop&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;B&gt;table&lt;/B&gt; &lt;P&gt;&lt;I&gt;market_temp;&lt;/I&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;Is generating this error:&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/8787.untitled.JPG"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/11/8787.untitled.JPG" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;And I cant figure out whats wrong in the syntax (due to the GROUP BY clause demanded by the SUM())..&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;any light?!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jan 2011 19:22:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-If-Else-statement-during-LOAD/m-p/166550#M38456</guid>
      <dc:creator />
      <dc:date>2011-01-12T19:22:12Z</dc:date>
    </item>
    <item>
      <title>Using If/Else statement during LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Using-If-Else-statement-during-LOAD/m-p/166551#M38457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Thiago,&lt;/P&gt;&lt;P&gt;It seems that you have your If() function in two lines, which is not valid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;if([Partner Code] = 'NOT FOUND' OR LEN(TRIM([Partner Code])) = 0, 'no', 'yes') as temnodic&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;This should work.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jan 2011 19:33:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-If-Else-statement-during-LOAD/m-p/166551#M38457</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-01-12T19:33:36Z</dc:date>
    </item>
    <item>
      <title>Using If/Else statement during LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Using-If-Else-statement-during-LOAD/m-p/166552#M38458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Miguel,&lt;/P&gt;&lt;P&gt;Thx for asnwering again!&lt;/P&gt;&lt;P&gt;I tried it out, but there's something wrong with the SUM() function and the GROUP BY clause... qhen I comment both lines, the code runs fine...&lt;/P&gt;&lt;P&gt;Any thoughts???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jan 2011 20:09:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-If-Else-statement-during-LOAD/m-p/166552#M38458</guid>
      <dc:creator />
      <dc:date>2011-01-12T20:09:59Z</dc:date>
    </item>
    <item>
      <title>Using If/Else statement during LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Using-If-Else-statement-during-LOAD/m-p/166553#M38459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is that your GROUP BY load requires that all the fields are either GROUP BY keys, or calculated as aggregations. In your case, the IF statement is using the fields that are not in your GROUP BY keys.&lt;/P&gt;&lt;P&gt;You need to either declare PARTNER_CODE as your GROUP BY key, or enclose it in aggregation function, like MaxString(PARTNER_CODE) - then it will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jan 2011 21:20:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-If-Else-statement-during-LOAD/m-p/166553#M38459</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2011-01-12T21:20:35Z</dc:date>
    </item>
    <item>
      <title>Using If/Else statement during LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Using-If-Else-statement-during-LOAD/m-p/166554#M38460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Miguel/Oleg,&lt;/P&gt;&lt;P&gt;Thank you very much, your answers combined brought me the expected results.&lt;/P&gt;&lt;P&gt;I beg pardon for basic questions, but unfortunatelly, QV development lacks in step-by-step tutorials, books, etc... Let's hope it changes soon!&lt;/P&gt;&lt;P&gt;Owe you guys another one.&lt;/P&gt;&lt;P&gt;My best wishes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jan 2011 12:46:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-If-Else-statement-during-LOAD/m-p/166554#M38460</guid>
      <dc:creator />
      <dc:date>2011-01-13T12:46:44Z</dc:date>
    </item>
  </channel>
</rss>

