<?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 Comparing columns from different tables and count if in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Comparing-columns-from-different-tables-and-count-if/m-p/1810412#M66036</link>
    <description>&lt;P&gt;I am a newbie in Qlikview. Please help.&amp;nbsp; Here is my code.&lt;/P&gt;&lt;P&gt;Master:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;ManagerName, ClientName, Revenue&lt;BR /&gt;A, AA, 19&lt;BR /&gt;A, AA, 17&lt;BR /&gt;A, AC, 9&lt;BR /&gt;A, AD, 23&lt;BR /&gt;A, AE, 76&lt;BR /&gt;B, BA, 12&lt;BR /&gt;B, AA, 7&lt;BR /&gt;B, AB, 5&lt;BR /&gt;C, CA, 8&lt;BR /&gt;C, CB, 44&lt;BR /&gt;C, CC, 9&lt;BR /&gt;, ,&lt;BR /&gt;];&lt;BR /&gt;Info:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;ManagerName, Region, Product, Client&lt;BR /&gt;A, ASIA, Car, AA&lt;BR /&gt;A, ASIA, Car, AA&lt;BR /&gt;A, EUROPE, Bike, AC&lt;BR /&gt;B, ASIA, Cycle, BA&lt;/P&gt;&lt;P&gt;B, ASIA, Laptop, BA&lt;BR /&gt;B, AMERICA, Pen, AA&lt;BR /&gt;B, EUROPE, Cap, AB&lt;BR /&gt;C, ASIA, Mobile, CA&lt;BR /&gt;C, EUROPE, Plane, CB&lt;BR /&gt;C, EUROPE, Car, CB&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Client and ClientName are same fields with different names.&lt;/P&gt;&lt;P&gt;Requirement:&lt;/P&gt;&lt;P&gt;I want to have an output table with ManagerName, Region, Product, ClientCount.&amp;nbsp; From Table "info", for a given manager, I want to count only those clients who have revenues more than 10. Output table can be in front end using set analysis or on Code as separate table. Either works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To make it clearer, This will be the process in Excel.&lt;/P&gt;&lt;P&gt;1. Filter a given Manager name in both tables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Filter client names in Table "Master" with revenues more than 10.&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Take client names more than 10 from above step and apply that as filter in clients column of table "info"&lt;/P&gt;&lt;P&gt;4. Delete other rows in table "info"&lt;/P&gt;&lt;P&gt;5. Repeat above steps for all managers.&lt;/P&gt;&lt;P&gt;6. In the resulting table, take client count grouping for ManagerName, product, region in Table "Info" and delete clients column.&lt;/P&gt;&lt;P&gt;Many Many Thanks in advance!!&lt;/P&gt;</description>
    <pubDate>Tue, 30 Nov 2021 18:17:33 GMT</pubDate>
    <dc:creator>vizz3108</dc:creator>
    <dc:date>2021-11-30T18:17:33Z</dc:date>
    <item>
      <title>Comparing columns from different tables and count if</title>
      <link>https://community.qlik.com/t5/App-Development/Comparing-columns-from-different-tables-and-count-if/m-p/1810412#M66036</link>
      <description>&lt;P&gt;I am a newbie in Qlikview. Please help.&amp;nbsp; Here is my code.&lt;/P&gt;&lt;P&gt;Master:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;ManagerName, ClientName, Revenue&lt;BR /&gt;A, AA, 19&lt;BR /&gt;A, AA, 17&lt;BR /&gt;A, AC, 9&lt;BR /&gt;A, AD, 23&lt;BR /&gt;A, AE, 76&lt;BR /&gt;B, BA, 12&lt;BR /&gt;B, AA, 7&lt;BR /&gt;B, AB, 5&lt;BR /&gt;C, CA, 8&lt;BR /&gt;C, CB, 44&lt;BR /&gt;C, CC, 9&lt;BR /&gt;, ,&lt;BR /&gt;];&lt;BR /&gt;Info:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;ManagerName, Region, Product, Client&lt;BR /&gt;A, ASIA, Car, AA&lt;BR /&gt;A, ASIA, Car, AA&lt;BR /&gt;A, EUROPE, Bike, AC&lt;BR /&gt;B, ASIA, Cycle, BA&lt;/P&gt;&lt;P&gt;B, ASIA, Laptop, BA&lt;BR /&gt;B, AMERICA, Pen, AA&lt;BR /&gt;B, EUROPE, Cap, AB&lt;BR /&gt;C, ASIA, Mobile, CA&lt;BR /&gt;C, EUROPE, Plane, CB&lt;BR /&gt;C, EUROPE, Car, CB&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Client and ClientName are same fields with different names.&lt;/P&gt;&lt;P&gt;Requirement:&lt;/P&gt;&lt;P&gt;I want to have an output table with ManagerName, Region, Product, ClientCount.&amp;nbsp; From Table "info", for a given manager, I want to count only those clients who have revenues more than 10. Output table can be in front end using set analysis or on Code as separate table. Either works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To make it clearer, This will be the process in Excel.&lt;/P&gt;&lt;P&gt;1. Filter a given Manager name in both tables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Filter client names in Table "Master" with revenues more than 10.&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Take client names more than 10 from above step and apply that as filter in clients column of table "info"&lt;/P&gt;&lt;P&gt;4. Delete other rows in table "info"&lt;/P&gt;&lt;P&gt;5. Repeat above steps for all managers.&lt;/P&gt;&lt;P&gt;6. In the resulting table, take client count grouping for ManagerName, product, region in Table "Info" and delete clients column.&lt;/P&gt;&lt;P&gt;Many Many Thanks in advance!!&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 18:17:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparing-columns-from-different-tables-and-count-if/m-p/1810412#M66036</guid>
      <dc:creator>vizz3108</dc:creator>
      <dc:date>2021-11-30T18:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing columns from different tables and count if</title>
      <link>https://community.qlik.com/t5/App-Development/Comparing-columns-from-different-tables-and-count-if/m-p/1811012#M66096</link>
      <description>&lt;P&gt;Hi Vizz3108,&lt;/P&gt;&lt;P&gt;try something like this in code:&lt;/P&gt;&lt;P&gt;mapRevenue:&lt;BR /&gt;mapping Load&lt;BR /&gt;ManagerName &amp;amp; '_' &amp;amp; ClientName as ManagerAndClient,&lt;BR /&gt;Sum(Revenue)&lt;BR /&gt;Resident Master&lt;BR /&gt;Group by ManagerName &amp;amp; '_' &amp;amp; ClientName;&lt;/P&gt;&lt;P&gt;NewTable:&lt;BR /&gt;Load&lt;BR /&gt;ManagerName &amp;amp; '_' &amp;amp; Region &amp;amp; '_' &amp;amp; Product as MngRegPrd,&lt;BR /&gt;Count(Client) as ClientCount&lt;BR /&gt;Resident Info&lt;BR /&gt;Where ApplyMap('mapRevenue', ManagerName &amp;amp; '_' &amp;amp; Client, 0) &amp;gt; 10&lt;BR /&gt;Group by ManagerName &amp;amp; '_' &amp;amp; Region &amp;amp; '_' &amp;amp; Product;&lt;/P&gt;&lt;P&gt;Qualify*;&lt;BR /&gt;Final:&lt;BR /&gt;Load&lt;BR /&gt;Left(MngRegPrd,Index(MngRegPrd, '_')-1) as ManagerName,&lt;BR /&gt;TextBetween(MngRegPrd,'_','_') as Region,&lt;BR /&gt;Right(MngRegPrd, Len(MngRegPrd)- Index(MngRegPrd,'_',2)) as Product,&lt;BR /&gt;ClientCount&lt;BR /&gt;Resident NewTable;&lt;BR /&gt;Drop Table NewTable;&lt;/P&gt;&lt;P&gt;I have seen, that in Table "Master" one Customer (AA) had two Managers (A, B) and i am not sure if this is correct. I assumed it was correct so i build a new field (ManagerName &amp;amp; '_' &amp;amp; ClientName as ManagerAndClient) in the mapping load to calculate the revenue of this customer for each manager.&lt;/P&gt;&lt;P&gt;I am sure there is a smoother way to do this but at least it is a temporarily fix.&lt;/P&gt;&lt;P&gt;Please double check if the results are correct.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Can&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 10:45:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparing-columns-from-different-tables-and-count-if/m-p/1811012#M66096</guid>
      <dc:creator>canerkan</dc:creator>
      <dc:date>2021-05-27T10:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing columns from different tables and count if</title>
      <link>https://community.qlik.com/t5/App-Development/Comparing-columns-from-different-tables-and-count-if/m-p/1811440#M66146</link>
      <description>&lt;P&gt;Many Thanks for the solution. Can you suggest an efficient way to split the key into various fields, since I have many fields in my case?&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 16:32:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparing-columns-from-different-tables-and-count-if/m-p/1811440#M66146</guid>
      <dc:creator>vizz3108</dc:creator>
      <dc:date>2021-05-28T16:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing columns from different tables and count if</title>
      <link>https://community.qlik.com/t5/App-Development/Comparing-columns-from-different-tables-and-count-if/m-p/1811659#M66187</link>
      <description>&lt;P&gt;Can you give me an example on how many fields are being used and how the key is build?&lt;/P&gt;</description>
      <pubDate>Mon, 31 May 2021 06:43:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparing-columns-from-different-tables-and-count-if/m-p/1811659#M66187</guid>
      <dc:creator>canerkan</dc:creator>
      <dc:date>2021-05-31T06:43:58Z</dc:date>
    </item>
  </channel>
</rss>

