<?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: convert SQL query in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/convert-SQL-query/m-p/60097#M9949</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let me say you my problem clearly.&lt;/P&gt;&lt;P&gt;I had a table in SQL server with about 1,000,000 records.&lt;/P&gt;&lt;P&gt;I loaded this table records in QlikView, there is no problem.&lt;/P&gt;&lt;P&gt;Problem start from time that i wanted calculate some expression. I couldn't calculate that in Qlik. Because that i have to write query in SQL, and load it in Qlik. This load process take long time.&lt;/P&gt;&lt;P&gt;My question is how to calculate this columns in Qlik.&lt;/P&gt;&lt;P&gt;I create sample data inline in Qlik that I send here.&lt;/P&gt;&lt;P&gt;My question is calculate expressions that i put in chart,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 20 May 2018 11:33:20 GMT</pubDate>
    <dc:creator>mrbqlik2009</dc:creator>
    <dc:date>2018-05-20T11:33:20Z</dc:date>
    <item>
      <title>convert SQL query</title>
      <link>https://community.qlik.com/t5/QlikView/convert-SQL-query/m-p/60092#M9944</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;I have sql query, how can write it in qlik view script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ItemTitle, CuName, Qty, SumAllByProduct,SumAllByProductTopOne&lt;/P&gt;&lt;P&gt; from&lt;/P&gt;&lt;P&gt; (&lt;/P&gt;&lt;P&gt;select ItemTitle, CuName, sum(Quantity) Qty&lt;/P&gt;&lt;P&gt;,(select sum(Quantity) From dbo.nvoice where ItemTitle=S.ItemTitle) SumAllByProduct&lt;/P&gt;&lt;P&gt;,(select sum(QtySum)&lt;/P&gt;&lt;P&gt;From( select top 10 ItemTitle, CuName, sum(Quantity) QtySum&lt;/P&gt;&lt;P&gt;from dbo.nvoice&lt;/P&gt;&lt;P&gt;where ItemTitle=S.ItemTitle&lt;/P&gt;&lt;P&gt;group by ItemTitle, CuName&lt;/P&gt;&lt;P&gt;order by qtySum DESC)HH) SumAllByProductTopOne&lt;/P&gt;&lt;P&gt;From dbo.nvoice S&lt;/P&gt;&lt;P&gt;group by ItemTitle, CuName&lt;/P&gt;&lt;P&gt;) as m&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 May 2018 09:14:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/convert-SQL-query/m-p/60092#M9944</guid>
      <dc:creator>mrbqlik2009</dc:creator>
      <dc:date>2018-05-19T09:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: convert SQL query</title>
      <link>https://community.qlik.com/t5/QlikView/convert-SQL-query/m-p/60093#M9945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a good reason why you want to convert the SQL into a load script query?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mean you can send this SQL as is via the ODBC or OLEDB driver like this in your load script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;m:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; *;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SQL&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; padding-left: 30px;"&gt;SELECT ItemTitle, CuName, Qty, SumAllByProduct,SumAllByProductTopOne&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; padding-left: 30px;"&gt;from&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; padding-left: 30px;"&gt;(&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; padding-left: 30px;"&gt;select ItemTitle, CuName, sum(Quantity) Qty&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; padding-left: 30px;"&gt;,(select sum(Quantity) From dbo.nvoice where ItemTitle=S.ItemTitle) SumAllByProduct&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; padding-left: 30px;"&gt;,(select sum(QtySum)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; padding-left: 30px;"&gt;From( select top 10 ItemTitle, CuName, sum(Quantity) QtySum&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; padding-left: 30px;"&gt;from dbo.nvoice&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; padding-left: 30px;"&gt;where ItemTitle=S.ItemTitle&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; padding-left: 30px;"&gt;group by ItemTitle, CuName&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; padding-left: 30px;"&gt;order by qtySum DESC)HH) SumAllByProductTopOne&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; padding-left: 30px;"&gt;From dbo.nvoice S&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; padding-left: 30px;"&gt;group by ItemTitle, CuName&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; padding-left: 30px;"&gt;) as m&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course it is possible to rewrite all of it to pure Qlik Load Script but is that really a needed here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 May 2018 14:50:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/convert-SQL-query/m-p/60093#M9945</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2018-05-19T14:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: convert SQL query</title>
      <link>https://community.qlik.com/t5/QlikView/convert-SQL-query/m-p/60094#M9946</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;SPAN style="font-size: 13.3333px;"&gt;dbo.nvoice have 1000000 records.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I load dbo.nvoice in my qlikview one time.&lt;/P&gt;&lt;P&gt;when i want run this sql query, and read from sql server it take a long time.&lt;/P&gt;&lt;P&gt;I want calculate &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Qty, SumAllByProduct,SumAllByProductTopOne in qlikview.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 May 2018 16:31:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/convert-SQL-query/m-p/60094#M9946</guid>
      <dc:creator>mrbqlik2009</dc:creator>
      <dc:date>2018-05-19T16:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: convert SQL query</title>
      <link>https://community.qlik.com/t5/QlikView/convert-SQL-query/m-p/60095#M9947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would go QVD approach in this regards as you have more rows. I mean you can load all the rows without any aggregations. Load your data into QVD as extract. Then load into QV from QVD then do the transformation. Something likle ELT process.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 May 2018 21:56:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/convert-SQL-query/m-p/60095#M9947</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2018-05-19T21:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: convert SQL query</title>
      <link>https://community.qlik.com/t5/QlikView/convert-SQL-query/m-p/60096#M9948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Blindly converting a SQL query into something that works in a load script is seldom a good idea.... so that's why I ask this question:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What does the fourth and fifth column in the result set from this SQL query give? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fourth seems to be straightforward as the total sum for each product (TitleName).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fifth is not so easy to understand. It doesn't make sense to me. Could you explain in plain english what you are trying to calculate here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 May 2018 11:13:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/convert-SQL-query/m-p/60096#M9948</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2018-05-20T11:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: convert SQL query</title>
      <link>https://community.qlik.com/t5/QlikView/convert-SQL-query/m-p/60097#M9949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let me say you my problem clearly.&lt;/P&gt;&lt;P&gt;I had a table in SQL server with about 1,000,000 records.&lt;/P&gt;&lt;P&gt;I loaded this table records in QlikView, there is no problem.&lt;/P&gt;&lt;P&gt;Problem start from time that i wanted calculate some expression. I couldn't calculate that in Qlik. Because that i have to write query in SQL, and load it in Qlik. This load process take long time.&lt;/P&gt;&lt;P&gt;My question is how to calculate this columns in Qlik.&lt;/P&gt;&lt;P&gt;I create sample data inline in Qlik that I send here.&lt;/P&gt;&lt;P&gt;My question is calculate expressions that i put in chart,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 May 2018 11:33:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/convert-SQL-query/m-p/60097#M9949</guid>
      <dc:creator>mrbqlik2009</dc:creator>
      <dc:date>2018-05-20T11:33:20Z</dc:date>
    </item>
  </channel>
</rss>

