<?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: Link 2 Sheets using common Fields in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Link-2-Sheets-using-common-Fields/m-p/1903276#M74501</link>
    <description>&lt;P&gt;There could be multiple ways to handle this situation, Two of them could be like below if it suits your case -&lt;/P&gt;
&lt;P&gt;1. You may concatenate both the tables and rename Date_1 and Date_2 to same name as Date, rename category_1 and category_2 to category in both the tables, this way your date and category filter will have all the dates and category, you would also create new field record_type('table1'/'table2') in both the tables to identify if a data row belongs to table 1 or table 2. This may be useful in set analysis expression in case you would need to filter data from a single table.&lt;/P&gt;
&lt;P&gt;Data Source:&lt;/P&gt;
&lt;P&gt;Table1:&lt;BR /&gt;LOAD *, Date_1 as Date, Category_1 AS Category, 'Table1' as Record_type INLINE [&lt;BR /&gt;Date_1, Category_1, Account_1&lt;BR /&gt;2022-03, Car, ABC-XY&lt;BR /&gt;2022-03, Bus, ABC-XA&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;Concatenate(Table1)&lt;BR /&gt;OAD *, Date_2 as Date, Category_2 AS Category, 'Table2' as Record_type INLINE [&lt;BR /&gt;Date_2, Category_2, Account_2, Net_Amount, Budget&lt;BR /&gt;2022-03, Car, ABC-XX, 1000, 4000&lt;BR /&gt;2022-03, Car, ABC-XY, 2000, 5000&lt;BR /&gt;2022-03, Bus, ABC-XU, 3000, 6000&lt;BR /&gt;2022-02, Car, ABC-XB, 6000, 8000&lt;BR /&gt;2022-03, Van, ABC-XC, 7000, 9000&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;2. You can create a link table between table1 and 2, it would have date and category field and a composite key from date and category to associate this link table with table 1 and table2, all three tables table1, table2 and link table will have this composite table. Keep Date and category fields only in link table.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/what-is-link-table-how-it-works-and-its-usage/m-p/1039484" target="_blank"&gt;https://community.qlik.com/t5/QlikView-App-Dev/what-is-link-table-how-it-works-and-its-usage/m-p/1039484&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Mar 2022 01:27:24 GMT</pubDate>
    <dc:creator>Digvijay_Singh</dc:creator>
    <dc:date>2022-03-10T01:27:24Z</dc:date>
    <item>
      <title>Link 2 Sheets using common Fields</title>
      <link>https://community.qlik.com/t5/App-Development/Link-2-Sheets-using-common-Fields/m-p/1903261#M74500</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;
&lt;P&gt;I've 2 tables: Table 1 &amp;amp; Table 2&lt;BR /&gt;For understanding purpose I've used fewer fields in sample data.&lt;/P&gt;
&lt;P&gt;Data Source:&lt;/P&gt;
&lt;P&gt;Table1:&lt;BR /&gt;LOAD *, Date_1&amp;amp;'$'&amp;amp;Category_1 AS Key1 INLINE [&lt;BR /&gt;Date_1, Category_1, Account_1&lt;BR /&gt;2022-03, Car, ABC-XY&lt;BR /&gt;2022-03, Bus, ABC-XA&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;Table2:&lt;BR /&gt;LOAD *, Date_2&amp;amp;'$'&amp;amp;Category_2 AS Key1 INLINE [&lt;BR /&gt;Date_2, Category_2, Account_2, Net_Amount, Budget&lt;BR /&gt;2022-03, Car, ABC-XX, 1000, 4000 &lt;BR /&gt;2022-03, Car, ABC-XY, 2000, 5000&lt;BR /&gt;2022-03, Bus, ABC-XU, 3000, 6000&lt;BR /&gt;2022-02, Car, ABC-XB, 6000, 8000&lt;BR /&gt;2022-03, Van, ABC-XC, 7000, 9000&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="1.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/74110i83D082537BC92C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.PNG" alt="1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my requirement:&lt;/P&gt;
&lt;P&gt;Year &amp;amp; Category filters should be common filters (list boxes) and on their selections it should &lt;BR /&gt;give results as per data in Table 1 (which is in Sheet1) &amp;amp; Table 2 (which is in Sheet 2).&lt;BR /&gt;The selections should work on both sheets and generate data without any loss.&lt;/P&gt;
&lt;P&gt;I've created composite key using fields Date&amp;amp;'$'&amp;amp;Category but the problem is when &lt;BR /&gt;I select Date_1 then only the matching records will filter out in Table_2 and I see the data discrepancy.&lt;/P&gt;
&lt;P&gt;To fix this issue I've used subfield function like this: &lt;BR /&gt;Subfield(Date&amp;amp;'$'&amp;amp;Category,'$',1) for date &amp;amp; Subfield(Date&amp;amp;'$'&amp;amp;Category,'$',2) for category&lt;/P&gt;
&lt;P&gt;This approach fixes the issue but I want to ask you guys is this the right approach or not.&lt;/P&gt;
&lt;P&gt;else, is there any other way to achieve the output.&lt;/P&gt;
&lt;P&gt;Need your suggestions.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Erik&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 23:34:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Link-2-Sheets-using-common-Fields/m-p/1903261#M74500</guid>
      <dc:creator>erric3210</dc:creator>
      <dc:date>2022-03-09T23:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Link 2 Sheets using common Fields</title>
      <link>https://community.qlik.com/t5/App-Development/Link-2-Sheets-using-common-Fields/m-p/1903276#M74501</link>
      <description>&lt;P&gt;There could be multiple ways to handle this situation, Two of them could be like below if it suits your case -&lt;/P&gt;
&lt;P&gt;1. You may concatenate both the tables and rename Date_1 and Date_2 to same name as Date, rename category_1 and category_2 to category in both the tables, this way your date and category filter will have all the dates and category, you would also create new field record_type('table1'/'table2') in both the tables to identify if a data row belongs to table 1 or table 2. This may be useful in set analysis expression in case you would need to filter data from a single table.&lt;/P&gt;
&lt;P&gt;Data Source:&lt;/P&gt;
&lt;P&gt;Table1:&lt;BR /&gt;LOAD *, Date_1 as Date, Category_1 AS Category, 'Table1' as Record_type INLINE [&lt;BR /&gt;Date_1, Category_1, Account_1&lt;BR /&gt;2022-03, Car, ABC-XY&lt;BR /&gt;2022-03, Bus, ABC-XA&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;Concatenate(Table1)&lt;BR /&gt;OAD *, Date_2 as Date, Category_2 AS Category, 'Table2' as Record_type INLINE [&lt;BR /&gt;Date_2, Category_2, Account_2, Net_Amount, Budget&lt;BR /&gt;2022-03, Car, ABC-XX, 1000, 4000&lt;BR /&gt;2022-03, Car, ABC-XY, 2000, 5000&lt;BR /&gt;2022-03, Bus, ABC-XU, 3000, 6000&lt;BR /&gt;2022-02, Car, ABC-XB, 6000, 8000&lt;BR /&gt;2022-03, Van, ABC-XC, 7000, 9000&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;2. You can create a link table between table1 and 2, it would have date and category field and a composite key from date and category to associate this link table with table 1 and table2, all three tables table1, table2 and link table will have this composite table. Keep Date and category fields only in link table.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/what-is-link-table-how-it-works-and-its-usage/m-p/1039484" target="_blank"&gt;https://community.qlik.com/t5/QlikView-App-Dev/what-is-link-table-how-it-works-and-its-usage/m-p/1039484&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 01:27:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Link-2-Sheets-using-common-Fields/m-p/1903276#M74501</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2022-03-10T01:27:24Z</dc:date>
    </item>
  </channel>
</rss>

