<?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 Create Set Analysis from SQL Statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-Set-Analysis-from-SQL-Statement/m-p/677533#M475592</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please what is the equivalent of this SQL Statement in SET Analysis ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT&amp;nbsp; Aux.DRADV, SUM(Aux.nbre_de_lignes)&lt;/P&gt;&lt;P&gt;FROM (&lt;/P&gt;&lt;P&gt;SELECT DISTINCT dr.Date_de_reception_ADV as DRADV, dd.*&lt;/P&gt;&lt;P&gt;FROM adv.dataadvagent dr, adv.dataadvagent dd &lt;/P&gt;&lt;P&gt;WHERE dr.Date_de_reception_ADV &amp;lt; dd.date_de_traitement&lt;/P&gt;&lt;P&gt;AND dd.Date_de_reception_ADV &amp;lt;= dr.Date_de_reception_ADV&lt;/P&gt;&lt;P&gt;AND dr.Date_de_reception_ADV IS NOT NULL AND dr.date_de_traitement IS NOT NULL AND dd.Date_de_reception_ADV IS NOT NULL AND dd.date_de_traitement IS NOT NULL&lt;/P&gt;&lt;P&gt;) Aux&lt;/P&gt;&lt;P&gt;GROUP BY Aux.DRADV&lt;/P&gt;&lt;P&gt;LIMIT 2000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Jul 2014 12:30:39 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-07-15T12:30:39Z</dc:date>
    <item>
      <title>Create Set Analysis from SQL Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Create-Set-Analysis-from-SQL-Statement/m-p/677533#M475592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please what is the equivalent of this SQL Statement in SET Analysis ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT&amp;nbsp; Aux.DRADV, SUM(Aux.nbre_de_lignes)&lt;/P&gt;&lt;P&gt;FROM (&lt;/P&gt;&lt;P&gt;SELECT DISTINCT dr.Date_de_reception_ADV as DRADV, dd.*&lt;/P&gt;&lt;P&gt;FROM adv.dataadvagent dr, adv.dataadvagent dd &lt;/P&gt;&lt;P&gt;WHERE dr.Date_de_reception_ADV &amp;lt; dd.date_de_traitement&lt;/P&gt;&lt;P&gt;AND dd.Date_de_reception_ADV &amp;lt;= dr.Date_de_reception_ADV&lt;/P&gt;&lt;P&gt;AND dr.Date_de_reception_ADV IS NOT NULL AND dr.date_de_traitement IS NOT NULL AND dd.Date_de_reception_ADV IS NOT NULL AND dd.date_de_traitement IS NOT NULL&lt;/P&gt;&lt;P&gt;) Aux&lt;/P&gt;&lt;P&gt;GROUP BY Aux.DRADV&lt;/P&gt;&lt;P&gt;LIMIT 2000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jul 2014 12:30:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-Set-Analysis-from-SQL-Statement/m-p/677533#M475592</guid>
      <dc:creator />
      <dc:date>2014-07-15T12:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create Set Analysis from SQL Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Create-Set-Analysis-from-SQL-Statement/m-p/677534#M475593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no equivalent. Set analysis is used in chart expressions. It cannot be used in the script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jul 2014 12:37:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-Set-Analysis-from-SQL-Statement/m-p/677534#M475593</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-07-15T12:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create Set Analysis from SQL Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Create-Set-Analysis-from-SQL-Statement/m-p/677535#M475594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, It's not possible to write a SET Analysis that will give me the same result ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jul 2014 14:38:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-Set-Analysis-from-SQL-Statement/m-p/677535#M475594</guid>
      <dc:creator />
      <dc:date>2014-07-15T14:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create Set Analysis from SQL Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Create-Set-Analysis-from-SQL-Statement/m-p/677536#M475595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, that's not possible. You will have to use a chart object and add a dimension and an expression. The expression can be a set analysis expression that can filter the set of records using some of the criteria your sql statement also contains. But a set analysis expression cannot generate a multi-column record set.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jul 2014 14:48:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-Set-Analysis-from-SQL-Statement/m-p/677536#M475595</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-07-15T14:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create Set Analysis from SQL Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Create-Set-Analysis-from-SQL-Statement/m-p/677537#M475596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's exactly what I would like to do. Create a chart that display the KPI obtains from the statement by date.&lt;/P&gt;&lt;P&gt;But at the Expression page I don't know what to write to get the KPI.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jul 2014 15:23:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-Set-Analysis-from-SQL-Statement/m-p/677537#M475596</guid>
      <dc:creator />
      <dc:date>2014-07-15T15:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Create Set Analysis from SQL Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Create-Set-Analysis-from-SQL-Statement/m-p/677538#M475597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First you will need to load the data. You can use your original sql statement or load the unaggregated data using only the sub-select statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MyData:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SQL SELECT DISTINCT dr.Date_de_reception_ADV as DRADV, dd.*&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM adv.dataadvagent dr, adv.dataadvagent dd&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;WHERE dr.Date_de_reception_ADV &amp;lt; dd.date_de_traitement&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;AND dd.Date_de_reception_ADV &amp;lt;= dr.Date_de_reception_ADV&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;AND dr.Date_de_reception_ADV IS NOT NULL AND dr.date_de_traitement IS NOT NULL AND dd.Date_de_reception_ADV IS NOT NULL AND dd.date_de_traitement IS NOT NULL&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM &lt;EM&gt;...mysourcetable...&lt;/EM&gt;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Once you've load the data you can create for example a straight table object with the field &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;EM&gt;DRADV&lt;/EM&gt;&lt;/SPAN&gt; as dimension and as expression &lt;EM&gt;sum([dd.&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;nbre_de_lignes]&lt;/SPAN&gt;)&lt;/EM&gt;. I'm not sure of the field names in your document. I'm just guessing based on the sql statement you posted. Make sure to use the exact case-sensitive field names. The expression editor allows you to select the field names and paste them into the expression. That way you can be sure you get it right.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 13:51:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-Set-Analysis-from-SQL-Statement/m-p/677538#M475597</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-07-16T13:51:32Z</dc:date>
    </item>
  </channel>
</rss>

