<?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: SQL 2008 import - IF statement loading data into two lines instead of one in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/SQL-2008-import-IF-statement-loading-data-into-two-lines-instead/m-p/456164#M170309</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Darren,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What your script is doing is reading the 11 lines in your SQL Table and then creating 1 line when OptitimeResourceID matches and another for when Operative Number matches. I'd guess the third line is the other 8 lines rolled up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you load your data into a QV table first, you can then create your desired table as follows ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FirstTouchProfiles:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UserName as "SHGUserName",&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value as "OptitimeResourceID"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Data&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where PropertyName='OptiTime_ResourceID';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;left join (FirstTouchProfiles)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UserName as "SHGUserName",&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value as "Operative Number"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Data&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where PropertyName='Operative Number';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP TABLE Data;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Nov 2012 15:09:18 GMT</pubDate>
    <dc:creator>flipside</dc:creator>
    <dc:date>2012-11-21T15:09:18Z</dc:date>
    <item>
      <title>SQL 2008 import - IF statement loading data into two lines instead of one</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-2008-import-IF-statement-loading-data-into-two-lines-instead/m-p/456163#M170308</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;BR /&gt;When importing from sql my data is appearing on 2 lines instead of one.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="25436" class="jive-image-thumbnail jive-image jiveImage" alt="B.jpg" src="https://community.qlik.com/legacyfs/online/25436_B.jpg" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this is because I'm trying to link the information by IF Statements. Is there a better way to load this?&lt;/P&gt;&lt;P&gt;My script is:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="25437" class="jive-image-thumbnail jive-image jiveImage" alt="C.jpg" src="https://community.qlik.com/legacyfs/online/25437_C.jpg" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My SQL2008 Table looks like this. &lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="25432" class="jive-image-thumbnail jive-image" onclick="" alt="A.jpg" src="https://community.qlik.com/legacyfs/online/25432_A.jpg" width="450" /&gt;&lt;/P&gt;&lt;P&gt;Can you please help.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Darren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 14:26:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-2008-import-IF-statement-loading-data-into-two-lines-instead/m-p/456163#M170308</guid>
      <dc:creator>darren_dixon</dc:creator>
      <dc:date>2012-11-21T14:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: SQL 2008 import - IF statement loading data into two lines instead of one</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-2008-import-IF-statement-loading-data-into-two-lines-instead/m-p/456164#M170309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Darren,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What your script is doing is reading the 11 lines in your SQL Table and then creating 1 line when OptitimeResourceID matches and another for when Operative Number matches. I'd guess the third line is the other 8 lines rolled up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you load your data into a QV table first, you can then create your desired table as follows ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FirstTouchProfiles:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UserName as "SHGUserName",&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value as "OptitimeResourceID"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Data&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where PropertyName='OptiTime_ResourceID';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;left join (FirstTouchProfiles)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UserName as "SHGUserName",&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value as "Operative Number"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Data&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where PropertyName='Operative Number';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP TABLE Data;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 15:09:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-2008-import-IF-statement-loading-data-into-two-lines-instead/m-p/456164#M170309</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2012-11-21T15:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: SQL 2008 import - IF statement loading data into two lines instead of one</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-2008-import-IF-statement-loading-data-into-two-lines-instead/m-p/456165#M170310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Flipside,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response.&lt;/P&gt;&lt;P&gt;Basic question but could you point me in the direction loading my data into a QV table.&lt;/P&gt;&lt;P&gt;My experience of Qlikview has only led me to import directly from SQL tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Darren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 15:39:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-2008-import-IF-statement-loading-data-into-two-lines-instead/m-p/456165#M170310</guid>
      <dc:creator>darren_dixon</dc:creator>
      <dc:date>2012-11-21T15:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: SQL 2008 import - IF statement loading data into two lines instead of one</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-2008-import-IF-statement-loading-data-into-two-lines-instead/m-p/456166#M170311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, no problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the QV load script, first load data as follows into a table called Data (or tmp or whatever you like):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SQL SELECT {your command}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... then use the code I posted earlier.&amp;nbsp; The word Resident references a previously loaded QV table in the script, and you can drop the table after because you won't need it again. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you only need the two fields, then you could filter your sql to where PropertyName = etc, etc, but if only a few rows in total it probably won't be worth it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 15:47:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-2008-import-IF-statement-loading-data-into-two-lines-instead/m-p/456166#M170311</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2012-11-21T15:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: SQL 2008 import - IF statement loading data into two lines instead of one</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-2008-import-IF-statement-loading-data-into-two-lines-instead/m-p/456167#M170312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This worked perfectly.&lt;/P&gt;&lt;P&gt;Thank you very much for your help. Greatly appriciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Darren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 16:47:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-2008-import-IF-statement-loading-data-into-two-lines-instead/m-p/456167#M170312</guid>
      <dc:creator>darren_dixon</dc:creator>
      <dc:date>2012-11-21T16:47:34Z</dc:date>
    </item>
  </channel>
</rss>

