<?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 Help requested with T-SQL script in Qlikview in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-requested-with-T-SQL-script-in-Qlikview/m-p/204084#M715608</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mikka&lt;/P&gt;&lt;P&gt;Couldn't get this to work but I follow your logic and was able to get it to work by using RESIDENT.&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Sep 2010 09:21:10 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-09-17T09:21:10Z</dc:date>
    <item>
      <title>Help requested with T-SQL script in Qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/Help-requested-with-T-SQL-script-in-Qlikview/m-p/204079#M715603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Generally Qlikview is great at processing scripts copied and pasted directly from T-SQL. So a SELECT * FROM x WHERE .... type script works perfectly fine, even if it is quite complex (lots of inner and outer joins, CASE WHEN statements, etc etc).&lt;/P&gt;&lt;P&gt;However, I've run into a problem where the SQL script relies on a temporary disk table. The following script format is running okay (i.e. Qlikview reports no errors and returns back to the application when it has finished and displays the Select Fields box). But no data is returned.&lt;/P&gt;&lt;P style="font-style: italic"&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;QlikviewTable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;SQL SELECT * INTO #temp FROM dbo.x&lt;BR /&gt;SELECT a, b, SUM(c), COUNT(d) FROM #temp GROUP BY a, b&lt;BR /&gt;DROP #temp;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Could someone tell me what I am doing wrong and how I can fix this? In the above simple example, I need the data from SELECT a, b, SUM(c), COUNT(d) FROM #temp GROUP BY a, b to be returned into the table &lt;EM&gt;QlikviewTable&lt;/EM&gt;. Running the script on my SQL Server gives exactly this.&lt;/P&gt;&lt;P&gt;With thanks&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Sep 2010 11:06:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-requested-with-T-SQL-script-in-Qlikview/m-p/204079#M715603</guid>
      <dc:creator />
      <dc:date>2010-09-16T11:06:24Z</dc:date>
    </item>
    <item>
      <title>Help requested with T-SQL script in Qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/Help-requested-with-T-SQL-script-in-Qlikview/m-p/204080#M715604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this: &lt;CODE&gt;TableA: SQL SELECT * FROM dbo.x STORE TableA INTO TableA.qvd; NOCONCATENATE QlikviewTable: LOAD a, b, SUM(c), COUNT(d) RESIDENT TableA GROUP BY a, b; DROP TableA;&lt;/CODE&gt; Cheers Naveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Sep 2010 12:15:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-requested-with-T-SQL-script-in-Qlikview/m-p/204080#M715604</guid>
      <dc:creator />
      <dc:date>2010-09-16T12:15:54Z</dc:date>
    </item>
    <item>
      <title>Help requested with T-SQL script in Qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/Help-requested-with-T-SQL-script-in-Qlikview/m-p/204081#M715605</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;This works for me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;Temp_Table:&lt;BR /&gt;SQL SELECT * INTO temp&lt;BR /&gt;FROM dbo."Dim_Dates";&lt;BR /&gt;&lt;BR /&gt;QV_table:&lt;BR /&gt;Load *;&lt;BR /&gt;Select&lt;BR /&gt; DateShortInt,&lt;BR /&gt; Count(DateShortInt) as No_Days&lt;BR /&gt;From&lt;BR /&gt; temp&lt;BR /&gt;Group By DateShortInt;&lt;BR /&gt;&lt;BR /&gt;SQL Drop table temp;&lt;BR /&gt;[\code]&lt;BR /&gt;&lt;BR /&gt;This gives me 1 table: QV_table. Altough this doesn't drop sql-table temp.&lt;BR /&gt;&lt;BR /&gt;Miikka&amp;lt;/body&amp;gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Sep 2010 12:20:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-requested-with-T-SQL-script-in-Qlikview/m-p/204081#M715605</guid>
      <dc:creator>miikkaqlick</dc:creator>
      <dc:date>2010-09-16T12:20:45Z</dc:date>
    </item>
    <item>
      <title>Help requested with T-SQL script in Qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/Help-requested-with-T-SQL-script-in-Qlikview/m-p/204082#M715606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is simpler than that:&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;temp:&lt;BR /&gt;SQL SELECT a,b,c,d FROM dbo.x;&lt;BR /&gt;//&lt;BR /&gt;QlikviewTable:&lt;BR /&gt;LOAD&lt;BR /&gt; a,&lt;BR /&gt; b,&lt;BR /&gt; SUM(c) as SumC,&lt;BR /&gt; COUNT(d) as CountD&lt;BR /&gt;RESIDENT temp&lt;BR /&gt;GROUP BY a, b;&lt;BR /&gt;//&lt;BR /&gt;DROP TABLE temp;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Sep 2010 20:51:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-requested-with-T-SQL-script-in-Qlikview/m-p/204082#M715606</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-09-16T20:51:56Z</dc:date>
    </item>
    <item>
      <title>Help requested with T-SQL script in Qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/Help-requested-with-T-SQL-script-in-Qlikview/m-p/204083#M715607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would be easy if you encapsulate your T-SDQL code into a stored procedure and then execute with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sql exec yourprocedurename;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Sep 2010 21:23:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-requested-with-T-SQL-script-in-Qlikview/m-p/204083#M715607</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2010-09-16T21:23:16Z</dc:date>
    </item>
    <item>
      <title>Help requested with T-SQL script in Qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/Help-requested-with-T-SQL-script-in-Qlikview/m-p/204084#M715608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mikka&lt;/P&gt;&lt;P&gt;Couldn't get this to work but I follow your logic and was able to get it to work by using RESIDENT.&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Sep 2010 09:21:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-requested-with-T-SQL-script-in-Qlikview/m-p/204084#M715608</guid>
      <dc:creator />
      <dc:date>2010-09-17T09:21:10Z</dc:date>
    </item>
    <item>
      <title>Help requested with T-SQL script in Qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/Help-requested-with-T-SQL-script-in-Qlikview/m-p/204085#M715609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much to you all for your help.&lt;/P&gt;&lt;P&gt;By using resident I was able to solve my immediate problem.&lt;/P&gt;&lt;P&gt;I'm still not sure this would work if the second chunk of SQL code was particularly complex (because essentially the first bit is SQL, the second is a LOAD statement in a QV script). In this case, I would have to use a stored procedure as Clever Anjos suggested.&lt;/P&gt;&lt;P&gt;A SP would have been the easiest thing to do - if only the IT department allowed me to create my own SPs and Views!! Right now I don't have access to do this, but fortunately, that's going to change soon.&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Sep 2010 09:25:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-requested-with-T-SQL-script-in-Qlikview/m-p/204085#M715609</guid>
      <dc:creator />
      <dc:date>2010-09-17T09:25:13Z</dc:date>
    </item>
  </channel>
</rss>

