<?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: Merging two tables in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Merging-two-tables/m-p/1588288#M43063</link>
    <description>thank'sssssssssss&lt;BR /&gt;</description>
    <pubDate>Tue, 04 Jun 2019 16:34:38 GMT</pubDate>
    <dc:creator>ecabanas</dc:creator>
    <dc:date>2019-06-04T16:34:38Z</dc:date>
    <item>
      <title>Merging two tables</title>
      <link>https://community.qlik.com/t5/App-Development/Merging-two-tables/m-p/1587737#M43023</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I making a table to count the number of customers that bought a category.&lt;/P&gt;&lt;P&gt;I'm making this script to create the tables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////Customer_912///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

min_date_912:
LOAD 
    MIN(Createat_Counter) AS MIN_DFINAN, 
    MAX(Createat_Counter) AS MAX_DFINAN
resident Customer_counter;
let vminyear=year(PEEK('MIN_DFINAN',0,'min_date_Sales'));
let vmaxyear=year(peek('MAX_DFINAN',0,'min_date_Sales'));

Counter_912:
LOAD 
	COUNT(DISTINCT SalesId_Counter) AS Contador_YearlyOrders_912,
	//Customer_Counter as Custaccount,
    $(vminyear) as CalendarYear_C
    //Customer_Counter &amp;amp;'-'&amp;amp;$(vminyear) as Contador_Key
    RESIDENT Customer_counter
    WHERE Year_Counter ='$(vminyear)'and Cat_level_3_Counter = '912'
    GROUP BY $(vminyear);//Customer_Counter;

YearDiff=('$(vmaxyear)')-('$(vminyear)');

FOR N=1 TO $(YearDiff)

let vminyear=$(vminyear)+1;//year(PEEK('MIN_DFINAN',0,'min_date_Sales'));

CONCATENATE(Counter_912)
LOAD *;
LOAD 
	COUNT(DISTINCT SalesId_Counter) AS Contador_YearlyOrders_912,
	//Customer_Counter as Custaccount,
    $(vminyear) as CalendarYear_C
    //Customer_Counter &amp;amp;'-'&amp;amp;$(vminyear) as Contador_Key
    RESIDENT Customer_counter
    WHERE Year_Counter ='$(vminyear)'and Cat_level_3_Counter = '912'
    GROUP BY $(vminyear);//ustomer_Counter;
    	
NEXT

drop table min_date_912;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////Customer_911///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

min_date_911:
LOAD 
    MIN(Createat_Counter) AS MIN_DFINAN, 
    MAX(Createat_Counter) AS MAX_DFINAN
resident Customer_counter;
let vminyear=year(PEEK('MIN_DFINAN',0,'min_date_Sales'));
let vmaxyear=year(peek('MAX_DFINAN',0,'min_date_Sales'));

Counter_911:
LOAD 
	COUNT(DISTINCT SalesId_Counter) AS Contador_YearlyOrders_911,
	//Customer_Counter as Custaccount,
    $(vminyear) as CalendarYear_C
    RESIDENT Customer_counter
    WHERE Year_Counter ='$(vminyear)'and Cat_level_3_Counter = '911'
    GROUP BY $(vminyear);//Customer_Counter;

YearDiff=('$(vmaxyear)')-('$(vminyear)');

FOR N=1 TO $(YearDiff)

let vminyear=$(vminyear)+1;//year(PEEK('MIN_DFINAN',0,'min_date_Sales'));

CONCATENATE(Counter_911)
LOAD *;
LOAD 
	COUNT(DISTINCT SalesId_Counter) AS Contador_YearlyOrders_911,
	//Customer_Counter as Custaccount,
    $(vminyear) as CalendarYear_C
    //Customer_Counter &amp;amp;'-'&amp;amp;$(vminyear) as Contador_Key
    RESIDENT Customer_counter
    WHERE Year_Counter ='$(vminyear)'and Cat_level_3_Counter = '911'
    GROUP BY $(vminyear);//Customer_Counter;
    	
NEXT

drop table min_date_911;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result is two separated tables,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-06-03_18h12_42.png" style="width: 414px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/13087i6A43E6D12CD63649/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-06-03_18h12_42.png" alt="2019-06-03_18h12_42.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But I want to create only one table like&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;CalendarYear_C&lt;/TD&gt;&lt;TD&gt;Contador_YearlyOrders_912&lt;/TD&gt;&lt;TD&gt;Contador_YearlyOrders_911&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2012&lt;/TD&gt;&lt;TD&gt;125&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;120&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2013&lt;/TD&gt;&lt;TD&gt;158&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;169&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any Idea how to merge them?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:44:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Merging-two-tables/m-p/1587737#M43023</guid>
      <dc:creator>ecabanas</dc:creator>
      <dc:date>2024-11-16T20:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Merging two tables</title>
      <link>https://community.qlik.com/t5/App-Development/Merging-two-tables/m-p/1587777#M43027</link>
      <description>By the look of it I assume you could do a join.&lt;BR /&gt;&lt;BR /&gt;Contador_YearlyOrders:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;Load&lt;BR /&gt;CalendarYear_C,&lt;BR /&gt;Contador_YearlyOrders_911&lt;BR /&gt;Resident Counter_911;&lt;BR /&gt;Drop table Counter_911;&lt;BR /&gt;Join (Contador_YearlyOrders)&lt;BR /&gt;Load&lt;BR /&gt;CalendarYear_C,&lt;BR /&gt;Contador_YearlyOrders_912&lt;BR /&gt;Resident Counter_912;&lt;BR /&gt;DROP TABLE Counter_912;&lt;BR /&gt;</description>
      <pubDate>Mon, 03 Jun 2019 19:28:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Merging-two-tables/m-p/1587777#M43027</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-06-03T19:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Merging two tables</title>
      <link>https://community.qlik.com/t5/App-Development/Merging-two-tables/m-p/1588288#M43063</link>
      <description>thank'sssssssssss&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Jun 2019 16:34:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Merging-two-tables/m-p/1588288#M43063</guid>
      <dc:creator>ecabanas</dc:creator>
      <dc:date>2019-06-04T16:34:38Z</dc:date>
    </item>
  </channel>
</rss>

