<?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: Equivalent to Exists function in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Equivalent-to-Exists-function/m-p/2005951#M83249</link>
    <description>&lt;P&gt;Thank you. I will try this solution to see if it works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also did this which I must say it works:&lt;/P&gt;
&lt;P&gt;wallet:&lt;/P&gt;
&lt;P&gt;Load *&lt;/P&gt;
&lt;P&gt;From wallet;&lt;/P&gt;
&lt;P&gt;exchange:&lt;/P&gt;
&lt;P&gt;Load distinct wallet_id, 1 as has_exchange&lt;/P&gt;
&lt;P&gt;From Movements&lt;/P&gt;
&lt;P&gt;Where type = 'BUY' or type = 'SELL'&lt;/P&gt;
&lt;P&gt;wallet_final&lt;/P&gt;
&lt;P&gt;Load *&lt;/P&gt;
&lt;P&gt;resident wallets&lt;/P&gt;
&lt;P&gt;Left join *&lt;/P&gt;
&lt;P&gt;resident exchange;&lt;/P&gt;
&lt;P&gt;drop table wallet;&lt;/P&gt;
&lt;P&gt;drop table exchange;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Nov 2022 14:59:24 GMT</pubDate>
    <dc:creator>FabioManniti</dc:creator>
    <dc:date>2022-11-17T14:59:24Z</dc:date>
    <item>
      <title>Equivalent to Exists function</title>
      <link>https://community.qlik.com/t5/App-Development/Equivalent-to-Exists-function/m-p/2005877#M83232</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;In my editor I have imported two tables from my Database: wallet and movents.&lt;/P&gt;
&lt;P&gt;In the movements table I can find a field which tells me the type of movement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Into my wallet table I want to add a field which tells me whether for that wallet exists a certain type of movement or not.&lt;/P&gt;
&lt;P&gt;If I had to do it by MySQL Query, I would use this and I would like to know if is there anything similar in QLik editor.&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;SELECT w.*,
       EXISTS(
               SELECT 1
               FROM movements m
               WHERE m.wallet_id = w.id
                   AND m.type = 'BUY'
                  OR m.type = 'SELL'
           )AS has_exchange_movement
FROM wallet w&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 12:38:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Equivalent-to-Exists-function/m-p/2005877#M83232</guid>
      <dc:creator>FabioManniti</dc:creator>
      <dc:date>2022-11-17T12:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Exists function</title>
      <link>https://community.qlik.com/t5/App-Development/Equivalent-to-Exists-function/m-p/2005889#M83234</link>
      <description>&lt;P&gt;Depending on your scenario you may keep this sql-statement as it is within Qlik because Qlik doesn't execute any sql itself else just transferring the statement per driver to the database and receiving on the same way back the results.&lt;/P&gt;
&lt;P&gt;Beside this Qlik has an own exists() function but it will work differently to your shown example. I think I would try to solve your task with a mapping-approach, maybe something like the following:&lt;/P&gt;
&lt;P&gt;m: mapping load wallet_id, 1;&lt;BR /&gt;sql select wallet_id from movements&lt;BR /&gt;where type = 'BUY' or type = 'SELL';&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;load *, applymap('m', id, 0) as has_exchange_movements;&lt;BR /&gt;sql select * from wallet;&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 13:05:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Equivalent-to-Exists-function/m-p/2005889#M83234</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-11-17T13:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Exists function</title>
      <link>https://community.qlik.com/t5/App-Development/Equivalent-to-Exists-function/m-p/2005951#M83249</link>
      <description>&lt;P&gt;Thank you. I will try this solution to see if it works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also did this which I must say it works:&lt;/P&gt;
&lt;P&gt;wallet:&lt;/P&gt;
&lt;P&gt;Load *&lt;/P&gt;
&lt;P&gt;From wallet;&lt;/P&gt;
&lt;P&gt;exchange:&lt;/P&gt;
&lt;P&gt;Load distinct wallet_id, 1 as has_exchange&lt;/P&gt;
&lt;P&gt;From Movements&lt;/P&gt;
&lt;P&gt;Where type = 'BUY' or type = 'SELL'&lt;/P&gt;
&lt;P&gt;wallet_final&lt;/P&gt;
&lt;P&gt;Load *&lt;/P&gt;
&lt;P&gt;resident wallets&lt;/P&gt;
&lt;P&gt;Left join *&lt;/P&gt;
&lt;P&gt;resident exchange;&lt;/P&gt;
&lt;P&gt;drop table wallet;&lt;/P&gt;
&lt;P&gt;drop table exchange;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 14:59:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Equivalent-to-Exists-function/m-p/2005951#M83249</guid>
      <dc:creator>FabioManniti</dc:creator>
      <dc:date>2022-11-17T14:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Exists function</title>
      <link>https://community.qlik.com/t5/App-Development/Equivalent-to-Exists-function/m-p/2006103#M83261</link>
      <description>&lt;P&gt;G'day&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/204462"&gt;@FabioManniti&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Your solution will work fine but for large data sets the applymap() function is much more efficient.&lt;/P&gt;
&lt;P&gt;Cheers, Barnaby.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 20:50:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Equivalent-to-Exists-function/m-p/2006103#M83261</guid>
      <dc:creator>barnabyd</dc:creator>
      <dc:date>2022-11-17T20:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent to Exists function</title>
      <link>https://community.qlik.com/t5/App-Development/Equivalent-to-Exists-function/m-p/2007117#M83339</link>
      <description>&lt;P&gt;Thank you for the advice. I must admit this is way faster&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 15:27:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Equivalent-to-Exists-function/m-p/2007117#M83339</guid>
      <dc:creator>FabioManniti</dc:creator>
      <dc:date>2022-11-21T15:27:13Z</dc:date>
    </item>
  </channel>
</rss>

