<?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: subquery in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/subquery/m-p/1689781#M52678</link>
    <description>&lt;P&gt;The script I sent you works for me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you share yours?&lt;/P&gt;</description>
    <pubDate>Wed, 01 Apr 2020 10:24:42 GMT</pubDate>
    <dc:creator>lorenzoconforti</dc:creator>
    <dc:date>2020-04-01T10:24:42Z</dc:date>
    <item>
      <title>subquery</title>
      <link>https://community.qlik.com/t5/App-Development/subquery/m-p/1689428#M52629</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;There is something that i do easily&amp;nbsp; in SQL but can't succeed in QLIK Sense. i have a simple following Table1:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;rowid&lt;/STRONG&gt; | &lt;STRONG&gt;profit&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;40&lt;/P&gt;&lt;P&gt;i need to select the row with minimum value in the&amp;nbsp; profit column. so in sql it would be:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;select&lt;/FONT&gt; &lt;STRONG&gt;rowid&lt;/STRONG&gt;, &lt;STRONG&gt;profit&lt;/STRONG&gt; &lt;FONT color="#3366FF"&gt;from&lt;/FONT&gt;&amp;nbsp;Table1 &lt;FONT color="#3366FF"&gt;where&lt;/FONT&gt; &lt;STRONG&gt;profit&lt;/STRONG&gt; = (&lt;FONT color="#3366FF"&gt;select&lt;/FONT&gt; &lt;FONT color="#FF0000"&gt;min&lt;/FONT&gt; (&lt;STRONG&gt;profit&lt;/STRONG&gt; ) &lt;FONT color="#3366FF"&gt;from&lt;/FONT&gt;&amp;nbsp;Table1)&lt;/P&gt;&lt;P&gt;and the result would be of course the second row because 20 is the minimum value in the profit column.&lt;/P&gt;&lt;P&gt;but how do i the same thing with the load statement in QLIK sense ?&lt;/P&gt;&lt;P&gt;i tried with WHERE EXISTS or to define a variable with let statement and use it in where clause&amp;nbsp; but nothing works.&lt;/P&gt;&lt;P&gt;Please help&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 12:37:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/subquery/m-p/1689428#M52629</guid>
      <dc:creator>vladimirkup</dc:creator>
      <dc:date>2020-03-31T12:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: subquery</title>
      <link>https://community.qlik.com/t5/App-Development/subquery/m-p/1689498#M52639</link>
      <description>&lt;P&gt;You can't do it straight on your first load; you need to load the data first and then the get min value&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;Load * inline [&lt;BR /&gt;rowid, profit&lt;BR /&gt;1, 30&lt;BR /&gt;2, 20&lt;BR /&gt;3, 40&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;filter:&lt;BR /&gt;inner keep load&lt;BR /&gt;min(profit) as profit&lt;BR /&gt;resident Data&lt;BR /&gt;group by ;&lt;/P&gt;&lt;P&gt;Drop table filter;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Taken from here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-Scripting/Load-Record-with-Max-value-only/td-p/696289" target="_blank"&gt;https://community.qlik.com/t5/QlikView-Scripting/Load-Record-with-Max-value-only/td-p/696289&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 14:47:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/subquery/m-p/1689498#M52639</guid>
      <dc:creator>lorenzoconforti</dc:creator>
      <dc:date>2020-03-31T14:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: subquery</title>
      <link>https://community.qlik.com/t5/App-Development/subquery/m-p/1689760#M52672</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks, it worked great except that the original table&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;Data&lt;/STRONG&gt;&amp;nbsp;was changed and left only with min value row.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there a way to rewrite the load statement in a way that the Data table will remain unchanged and the resulted row with the min value will be loaded to a new table ? &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 09:50:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/subquery/m-p/1689760#M52672</guid>
      <dc:creator>vladimirkup</dc:creator>
      <dc:date>2020-04-01T09:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: subquery</title>
      <link>https://community.qlik.com/t5/App-Development/subquery/m-p/1689761#M52673</link>
      <description>&lt;P&gt;Just remove this part:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Drop table filter;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 09:58:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/subquery/m-p/1689761#M52673</guid>
      <dc:creator>lorenzoconforti</dc:creator>
      <dc:date>2020-04-01T09:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: subquery</title>
      <link>https://community.qlik.com/t5/App-Development/subquery/m-p/1689772#M52675</link>
      <description>&lt;P&gt;Did it but that kept the &lt;STRONG&gt;filter&lt;/STRONG&gt; table from deleting and the &lt;STRONG&gt;Data&lt;/STRONG&gt; table is still with the min value row only.&lt;/P&gt;&lt;P&gt;I am looking for a way keep the Data table from being changed and insert min value row to a new table&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 10:13:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/subquery/m-p/1689772#M52675</guid>
      <dc:creator>vladimirkup</dc:creator>
      <dc:date>2020-04-01T10:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: subquery</title>
      <link>https://community.qlik.com/t5/App-Development/subquery/m-p/1689773#M52676</link>
      <description>&lt;P&gt;Try renaming the field:&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;Load * inline [&lt;BR /&gt;rowid, profit&lt;BR /&gt;1, 30&lt;BR /&gt;2, 20&lt;BR /&gt;3, 40&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;filter:&lt;BR /&gt;inner keep load&lt;BR /&gt;min(profit) as minProfit&lt;BR /&gt;resident Data&lt;BR /&gt;group by ;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 10:15:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/subquery/m-p/1689773#M52676</guid>
      <dc:creator>lorenzoconforti</dc:creator>
      <dc:date>2020-04-01T10:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: subquery</title>
      <link>https://community.qlik.com/t5/App-Development/subquery/m-p/1689778#M52677</link>
      <description>No good. Now Data table is unchanged, but the inner keep didn't work. Probably because the name of the fields is not identical&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Apr 2020 10:22:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/subquery/m-p/1689778#M52677</guid>
      <dc:creator>vladimirkup</dc:creator>
      <dc:date>2020-04-01T10:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: subquery</title>
      <link>https://community.qlik.com/t5/App-Development/subquery/m-p/1689781#M52678</link>
      <description>&lt;P&gt;The script I sent you works for me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you share yours?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 10:24:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/subquery/m-p/1689781#M52678</guid>
      <dc:creator>lorenzoconforti</dc:creator>
      <dc:date>2020-04-01T10:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: subquery</title>
      <link>https://community.qlik.com/t5/App-Development/subquery/m-p/1689785#M52680</link>
      <description>I am running your script.&lt;BR /&gt;&lt;BR /&gt;I copy and paste your script to my Qlik Sence load editor, then press load button, go to my preview tab in model viewer and see thta both tables (Data table and filter table) are unchanged which is good. But I also don't see the resulted filtered row in a new table&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Apr 2020 10:32:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/subquery/m-p/1689785#M52680</guid>
      <dc:creator>vladimirkup</dc:creator>
      <dc:date>2020-04-01T10:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: subquery</title>
      <link>https://community.qlik.com/t5/App-Development/subquery/m-p/1689789#M52682</link>
      <description>&lt;P&gt;So, do you want to see three tables?&lt;/P&gt;&lt;P&gt;Data (unchanged)&lt;/P&gt;&lt;P&gt;Filter (with only one value)&lt;/P&gt;&lt;P&gt;3rd Table - what would you like to see in here? Data table with just one row?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 10:35:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/subquery/m-p/1689789#M52682</guid>
      <dc:creator>lorenzoconforti</dc:creator>
      <dc:date>2020-04-01T10:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: subquery</title>
      <link>https://community.qlik.com/t5/App-Development/subquery/m-p/1689803#M52684</link>
      <description>Yes, I would like to see in the 3rd table the selected row. In our case that would be:&lt;BR /&gt;&lt;BR /&gt;Rowid|Profit&lt;BR /&gt;&lt;BR /&gt;2 | 20&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Apr 2020 11:23:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/subquery/m-p/1689803#M52684</guid>
      <dc:creator>vladimirkup</dc:creator>
      <dc:date>2020-04-01T11:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: subquery</title>
      <link>https://community.qlik.com/t5/App-Development/subquery/m-p/1689807#M52685</link>
      <description>&lt;P&gt;How would you manage the situation where more rows have the minimum value? Would you still display only one row in this third table or multiple rows?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 11:30:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/subquery/m-p/1689807#M52685</guid>
      <dc:creator>lorenzoconforti</dc:creator>
      <dc:date>2020-04-01T11:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: subquery</title>
      <link>https://community.qlik.com/t5/App-Development/subquery/m-p/1689809#M52686</link>
      <description>I would need to display multiple rows&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Apr 2020 11:33:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/subquery/m-p/1689809#M52686</guid>
      <dc:creator>vladimirkup</dc:creator>
      <dc:date>2020-04-01T11:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: subquery</title>
      <link>https://community.qlik.com/t5/App-Development/subquery/m-p/1689851#M52687</link>
      <description>&lt;P&gt;Then the challenge will be synthetic keys and autoconcatenation; to resolve this, I used the qualify statement below; these will give you the 3 tables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;Load * inline [&lt;BR /&gt;rowid, profit&lt;BR /&gt;1, 30&lt;BR /&gt;2, 20&lt;BR /&gt;3, 40&lt;BR /&gt;4, 20&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;filter:&lt;BR /&gt;Load&lt;BR /&gt;1 as isMin,&lt;BR /&gt;min(profit) as profit&lt;BR /&gt;resident Data&lt;BR /&gt;group by ;&lt;/P&gt;&lt;P&gt;left join (Data) load * resident filter;&lt;/P&gt;&lt;P&gt;drop table filter;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;qualify *;&lt;BR /&gt;MinValueIds:&lt;BR /&gt;load * resident Data where (isMin = 1);&lt;/P&gt;&lt;P&gt;MinValue:&lt;BR /&gt;Load FirstValue(MinValueIds.isMin) as profit Resident MinValueIds Group by;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 13:34:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/subquery/m-p/1689851#M52687</guid>
      <dc:creator>lorenzoconforti</dc:creator>
      <dc:date>2020-04-01T13:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: subquery</title>
      <link>https://community.qlik.com/t5/App-Development/subquery/m-p/1691028#M52811</link>
      <description>&lt;P&gt;The&amp;nbsp;MinValueIds table now has two duplicate rows but except for that it worked.&lt;/P&gt;&lt;P&gt;Thanks a lot !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Apr 2020 11:56:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/subquery/m-p/1691028#M52811</guid>
      <dc:creator>vladimirkup</dc:creator>
      <dc:date>2020-04-05T11:56:06Z</dc:date>
    </item>
  </channel>
</rss>

